Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
6.12.0
-
None
-
2
-
Severity 3 - Minor
-
1
-
Description
Summary
Regex for TOC macro works differently between in the preview and in the page itself.
Steps to Reproduce
- Open a page in edit mode
- Insert headings which have the names below
- ABC
- BCD
- Insert Table of Contents Macro in the page
- Open a configuration dialog of the macro
- Set Include Headings option with using a regex B.+
- Hit Preview button
- 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.
Attachments
Issue Links
- causes
-
CONFSERVER-52586 Regex Isn't Working in TOC Macro
- Closed
-
CONFSERVER-43663 Preview from 'Table of Contents' with Include or Exclude Headings not work
- Closed
- has a derivative of
-
CONFSERVER-57537 Documentation update for TOC macro
- Gathering Interest