Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-22609

TOC is missing headings generated by macros when referencing a page different from the current one

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 16.4.4
    • None
    • None
    • Unknown

    Description

      Steps to reproduce

      1. Create Page-A.WebHome with following content:

      {{toc/}}
      
      == Section 1 ==
      
      == Section 2 ==
      
      {{velocity}}
      #foreach ($section in ['Section 3', 'Section 4'])
      == $section ==
      #end
      
      == Section 1000 ==
      
      {{/velocity}}
      

      The generated TOC contains the 5 sections headings, as expected

      2. Create Page-B.WebHome with following content:

      {{toc reference="Page-A.WebHome"/}}
      

      Expected result

      The generate TOC in Page-B is the same as the one generated in Page-A.

      Actual result

      In Page-B, the generated TOC contains only the headings outside the Velocity macro, i.e.:

      • Section 1
      • Section 2

      Attachments

        Activity

          People

            Unassigned Unassigned
            slauriere slauriere
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: