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 {{ partial "heading.html" (dict
"level" .Level "level" .Level
"text" (.Text | plainify | safeHTML) "text" (.Text | safeHTML)
"id" (.Attributes.id | default .Anchor) "id" (.Attributes.id | default .Anchor)
"class" .Attributes.class "class" .Attributes.class
) )

View File

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

View File

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