We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79cd915 commit 99ed708Copy full SHA for 99ed708
extensions/toc/templates/toc.html
@@ -1,6 +1,6 @@
1
{{ define "toc-item" }}
2
<li>
3
- <a href="#{{ printf "%s" .ID}}">{{ printf "%s" .Title}}</a>
+ <a href="#{{ printf "%s" .ID}}">{{ printf "%s" .Title | raw }}</a>
4
{{ with .Items }}
5
<ul class="menu-list">
6
{{ range . }}
helpers.go
@@ -28,6 +28,7 @@ var helpers = template.FuncMap{
28
"emoji": Emoji,
29
"base": path.Base,
30
"dir": dir,
31
+ "raw": raw,
32
}
33
34
var ErrHelperRegistered = errors.New("Helper already registered")
@@ -194,3 +195,8 @@ func dir(s string) string {
194
195
196
return v
197
198
+
199
+// raw a helper to output input string as safe HTML
200
+func raw(i string) template.HTML {
201
+ return template.HTML(i)
202
+}
0 commit comments