arturobernalg opened a new pull request, #559:
URL: https://github.com/apache/jspwiki/pull/559

   JSPWIKI-684: saving a page with the WYSIWYG editor, without changing 
anything, adds backslashes to a plugin that has plugins nested in it.
   
   Cause: when the HTML to wiki translator joins the lines of a plugin, 
WhitespaceTrimWriter finds the end of the plugin with a non greedy regex, which 
stops at the first closing brace and bracket, the one of the first nested 
plugin. The rest of the outer plugin keeps the line break markers the editor 
wrote.
   
   Fix: the end of the plugin is now the closing brace and bracket that 
balances its opening one. If the brackets do not balance, the first closing one 
is used as before, so nothing changes for that case.
   
   Measured before the fix, on a running instance with the wysiwyg editor: the 
page from the ticket (a Table with CurrentTimePlugin cells and a nested Table) 
was 337 bytes. Opening it in the editor and saving without edits made it 373 
bytes, and the cells ended up on one line joined by backslashes, as the ticket 
describes.
   
   Tests: new testPluginWithNestedPlugins in HtmlStringToWikiTranslatorTest 
compares a plugin with nested plugins against the same plugin without them. It 
fails without the fix and passes with it. jspwiki-wysiwyg (19 tests) and 
jspwiki-markdown (27 tests) pass.
   
   Not done: I did not rebuild the war and repeat the browser check with the 
fix, and nesting inside the code blocks {{{ }}} and {{ }} is not changed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to