Merge pull request #19973 from dvdksn/fix-toc-html

fix: pass heading text through md renderer
This commit is contained in:
David Karlsson 2024-05-11 14:17:08 +02:00 committed by GitHub
commit bbb894f3e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{{ partial "heading.html" (dict
"level" .Level
"text" (.Text | plainify | safeHTML)
"text" (.Text | safeHTML)
"id" (.Attributes.id | default .Anchor)
"class" .Attributes.class
)

View File

@ -30,7 +30,7 @@
{{- range . }}
{{- if and (ge .Level $min) (le .Level $max) }}
<li>
<a class="link lg:no-underline" href="#{{ .ID }}">{{ .Title }}</a>
<a class="link lg:no-underline" href="#{{ .ID }}">{{ markdownify .Title }}</a>
</li>
{{- end }}
{{- with .Headings }}

View File

@ -13,7 +13,7 @@
{{ else }}
href="#{{ $text | anchorize }}"
{{ end }}
>{{ plainify $text }}</a>
>{{ markdownify $text }}</a>
</li>
{{ end }}
</ul>