File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,11 +53,19 @@ func (an AnchorNormalizer) rewriteCrossReferences(doc *asciidoc.Document) {
5353 }
5454 continue
5555 }
56- anchorLabel := labelText (anchor .LabelElements )
56+ var anchorLabel string
57+ if an .options .NormalizeAnchors {
58+ if _ , isSection := anchor .Element .(* asciidoc.Section ); isSection {
59+ anchorLabel = library .SectionName (anchor .Element .(* asciidoc.Section ))
60+ }
61+ }
5762 if anchorLabel == "" {
58- section , isSection := anchor .Element .(* asciidoc.Section )
59- if isSection {
60- anchorLabel = library .SectionName (section )
63+ anchorLabel = labelText (anchor .LabelElements )
64+ if anchorLabel == "" {
65+ section , isSection := anchor .Element .(* asciidoc.Section )
66+ if isSection {
67+ anchorLabel = library .SectionName (section )
68+ }
6169 }
6270 }
6371 // We're going to be modifying the underlying array, so we need to make a copy of the slice
You can’t perform that action at this time.
0 commit comments