Skip to content

Commit

Permalink
Do not escape heading anchors unnecessarily (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Nov 8, 2023
1 parent 6ab8fab commit abeb16c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion layouts/_default/_markup/render-heading.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}<a class="headerlink" href="#{{ .Anchor | safeURL }}" title="Link to this heading">#</a></h{{ .Level }}>
{{ $id := .Anchor | anchorize -}}
{{- $anchor := printf "#%s" $id -}}
<h{{ .Level }} id="{{ $id }}">{{ .Text | safeHTML }}<a class="headerlink" {{ printf "href=%q" $anchor | safeHTMLAttr }} title="Link to this heading">#</a></h{{ .Level }}>

0 comments on commit abeb16c

Please sign in to comment.