Skip to content

Commit d592ffb

Browse files
toc embed fix
1 parent f040e63 commit d592ffb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

layouts/partials/docs-toc.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ <h2 class="font-medium my-3">On this page</h2>
3131
<!-- Close previous list item -->
3232
</li>
3333
{{ end }}
34-
<li><a href="#{{ $anchorID }}">{{ $header | plainify | safeHTML }}</a>
34+
<!-- Extract text content, excluding the header link icon -->
35+
{{ $headerText := $header | replaceRE `<a[^>]*class="header-link"[^>]*>.*?</a>` "" | plainify | safeHTML }}
36+
<li><a href="#{{ $anchorID }}">{{ $headerText }}</a>
3537
{{ $prevLevel = $level }}
3638
{{ end }}
3739
<!-- Close remaining open lists -->

0 commit comments

Comments
 (0)