Skip to content

Commit

Permalink
Record page anchor before header removal. fixes docToolchain#1161
Browse files Browse the repository at this point in the history
  • Loading branch information
srotman committed May 9, 2023
1 parent c9cc6f3 commit d64b553
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/asciidoc2confluence.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ def getPagesRecursive(Element element, String parentId, Map anchors, Map pageAnc
def pages = []
element.select("div.sect${level}").each { sect ->
def title = sect.select("h${level + 1}").text()
pageAnchors.putAll(recordPageAnchor(sect.select("h${level + 1}")))
Elements pageBody
if (level == 1) {
pageBody = sect.select('div.sectionbody')
Expand All @@ -955,7 +956,6 @@ def getPagesRecursive(Element element, String parentId, Map anchors, Map pageAnc
children: [],
parent: parentId
]
pageAnchors.putAll(recordPageAnchor(sect.select("h${level + 1}")))

if (maxLevel > level) {
currentPage.children.addAll(getPagesRecursive(sect, null, anchors, pageAnchors, level + 1, maxLevel))
Expand Down

0 comments on commit d64b553

Please sign in to comment.