diff options
Diffstat (limited to 'html_backend.go')
| -rw-r--r-- | html_backend.go | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/html_backend.go b/html_backend.go index 323b60b..32973e0 100644 --- a/html_backend.go +++ b/html_backend.go @@ -1160,18 +1160,7 @@ func htmlWriteSection(doc *Document, el *element, out io.Writer) { fmt.Fprintf(out, "\n<div class=%q>\n<%s id=%q>", class, tag, el.ID) - var ( - withSectAnchors bool - withSectlinks bool - ) - - _, withSectAnchors = doc.Attributes.Entry[docAttrSectAnchors] - if withSectAnchors { - fmt.Fprintf(out, - `<a class="anchor" href="#%s" aria-label="Anchor for %s"></a>`, - el.ID, el.ID) - } - _, withSectlinks = doc.Attributes.Entry[docAttrSectLinks] + _, withSectlinks := doc.Attributes.Entry[docAttrSectLinks] if withSectlinks { fmt.Fprintf(out, `<a class="link" href="#%s">`, el.ID) } @@ -1185,6 +1174,13 @@ func htmlWriteSection(doc *Document, el *element, out io.Writer) { if withSectlinks { fmt.Fprint(out, "</a>") } + + _, withSectAnchors := doc.Attributes.Entry[docAttrSectAnchors] + if withSectAnchors { + fmt.Fprintf(out, + `<a class="anchor" href="#%s" aria-label="Anchor for %s"></a>`, + el.ID, el.ID) + } fmt.Fprintf(out, "</%s>", tag) if el.kind == elKindSectionL1 { |
