Regex for TOC macro work differently between in preview and in page itself

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 6.12.0
    • None
    • 2
    • Severity 3 - Minor
    • 1

      Summary

      Regex for TOC macro works differently between in the preview and in the page itself.

      Steps to Reproduce

      1. Open a page in edit mode
      2. Insert headings which have the names below
        • ABC
        • BCD
      3. Insert Table of Contents Macro in the page
      4. Open a configuration dialog of the macro
      5. Set Include Headings option with using a regex B.+
      6. Hit Preview button
      7. Hip Save button

      Expected Results

      The preview and the page itself shows same headings with the macro.

      Actual Results

      The preview and the page itself shows different results. These behaviors are quite unintuitive for users.

      The preview shows only the heading "BCD".

      The page itself shows both "ABC" and "BCD".

      Notes

      From my investigation, the regex of Include Headings works as follows.

      In preview:

      Confluence uses the regex to match substring of each heading

      In page itself:

      Confluence uses the regex to match head of each heading

      It means, if we would like to match only "BCD" in the page itself, we need to use ^B.+ or ^B instead.

      Workaround

      Please try to use regex to match head of each heading.

        1. screenshot-1.png
          screenshot-1.png
          166 kB
        2. screenshot-2.png
          screenshot-2.png
          51 kB

            Assignee:
            Unassigned
            Reporter:
            Yuki Okamoto (Inactive)
            Votes:
            6 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: