Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 9.8.1
-
Component/s: Syntax - xhtml/1.0 & html/4.01, Syntax - xwiki/2.1
-
Labels:
-
Tests:Integration
-
Difficulty:Easy
-
Documentation:N/A
-
Documentation in Release Notes:N/A
-
Similar issues:
Description
For the need of a project I am parsing the HTML code generated by the wysiwyg editor in order to do some modifications on the blocks and after render it as XWiki syntax.
The problem is that in a particular case the html code is not rendered as expected.
For example if I try to render the following code, composed of span with some CSS classes followed by xwiki link:
<span class="label label-success noticeid">TEST</span><span class="wikiexternallink"><a href="http://www.google.fr/">LINK</a></span>
Actual result:
(% class="label label-success noticeid" %)TEST[[LINK>>url:http://www.google.fr/]]
See demo here
Expected result :
(% class="label label-success noticeid" %)TEST(%%)[[LINK>>url:http://www.google.fr/]]
If I convert the xwiki syntax result obtained from the parsing of the initial HTML code and convert it to HTML syntax , (reverse rendering), the result will be different from the initial HTML code :
<p><span class="label label-success noticeid">TEST<span class="wikiexternallink"><a href="http://www.google.fr/">LINK</a></span></span></p>
See the demo here
Note that, if we put a space between the first and the 2nd span on the initial HTML code, the rendering result will be correct.
<span class="label label-success noticeid">TEST</span> <span class="wikiexternallink"><a href="http://www.google.fr/">LINK</a></span>
The result will be :
(% class="label label-success noticeid" %)TEST(%%) [[LINK>>url:http://www.google.fr/]]
See a demo here