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

When there are two spans with metadata nested in each other, the metadata attributes aren't cleaned

    XMLWordPrintable

Details

    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      When saving content where macros have been repaired by the browser due to block content in inline macros, it can happen that there are two spans nested in each other that both contain metadata attributes. This can be reproduced with this content. Here is a snippet of the HTML that is submitted by the browser that causes the issue:

      <h2 id="HText1" style="text-align: center;" class="wikigeneratedid wikigeneratedheader"><span data-xwiki-non-generated-content="java.util.List&lt;org.xwiki.rendering.block.Block&gt;" data-xwiki-wikimacrocontent="true" class="xwiki-metadata-container"><span data-xwiki-non-generated-content="java.util.List&lt;org.xwiki.rendering.block.Block&gt;" data-xwiki-wikimacrocontent="true" class="xwiki-metadata-container"><span><span style="color:#ccffff">Text 1</span></span></span></span></h2>
      

      These metadata attributes are merged together into one element by WikiModel with a class that contains twice the value xwiki-metadata-container. Due to this, the cleanup code doesn't recognize this as metadata anymore and doesn't remove the metadata attributes such that they end up in XWiki syntax.

      Attachments

        Activity

          People

            MichaelHamann Michael Hamann
            MichaelHamann Michael Hamann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: