Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-570

Closing span are not considered before an open link when parsing XHTML

    XMLWordPrintable

Details

    • Integration
    • Easy
    • N/A
    • N/A

    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

      Attachments

        Activity

          People

            surli Simon Urli
            mouhb Mohamed Boussaa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h