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

Prepared macro content leads to duplicated IDs when inserted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 17.10.2
    • Transformation
    • None
    • Unknown

    Description

      Follow these steps to reproduce:

      • Create a page with this content:
        = Heading =
        
        = Heading =
        
      • Create a second page with this content:
        = Heading =
        
        {{info}}
        = Heading =
        {{/info}}
        
      • Create a third page that displays the first two:
        {{display reference="First.Page" /}}
        
        {{display reference="Second.Page" /}}
        
      • Check the heading IDs in the rendered HTML

      Expected: the heading IDs should be all unique: HHeading, HHeading-1, HHeading-2, HHeading-3
      Actual: we get duplicated section IDs: HHeading, HHeading-1, HHeading-2, HHeading-1

      The problem doesn't reproduce if we replace the info macro with the velocity macro. This shows that the problem is with macros that support wiki content. The content of these macros is prepared (cached XDOM). The heading from the prepared content gets a generated ID HHeading-1 that is unique in the scope of the second document. But when this prepared content is inserted in the content aggregated from both documents, the ID is not "fixed" (like we do in DocumentContentAsyncExecutor) so it duplicates existing IDs.

      Attachments

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: