8000
We read every piece of feedback, and take your input very seriously.
1 parent 200857d commit a7d2dfcCopy full SHA for a7d2dfc
layouts/partials/templates/blocks.html
@@ -9,8 +9,10 @@
9
{{ $section := $.ctx.Scratch.Get "section" }}
10
{{ $headers := findRE "<h2.*?>(.|\n)*?</h2>" $section }}
11
{{ range $headers }}
12
-{{ $header := . | replaceRE "</?h2.*?>" "" | htmlUnescape }}
13
-<li><a href="#{{ $header | anchorize }}">{{ $header }}</a></li>
+{{ $id := . | strings.TrimPrefix "<h2 id=\"" }}
+{{ $id := $id | replaceRE "\">.*" "" }}
14
+{{ $header := . | replaceRE "</?h2.*?>" "" | htmlUnescape | safeHTML }}
15
+<li><a href="#{{ $id }}">{{ $header }}</a></li>
16
{{ end }}
17
{{ $.ctx.Scratch.Add "sections" $section }}
18