Merge pull request #516 from schnerring/simplify-heading-rendering

Simplify heading rendering
This commit is contained in:
Henk Verlinde 2021-10-15 15:28:39 +02:00 committed by GitHub
commit ee6b5c4c3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 3 deletions

View File

@ -0,0 +1 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }} <a href="#{{ .Anchor | safeURL }}" class="anchor" aria-hidden="true">#</a></h{{ .Level }}>

View File

@ -31,7 +31,7 @@
{{ partial "sidebar/docs-toc.html" . }}
</nav>
{{ end -}}
{{ partial "main/headline-hash.html" .Content }}
{{ .Content }}
{{ if .Site.Params.editPage -}}
{{ partial "main/edit-page.html" . }}
{{ end -}}

View File

@ -1 +0,0 @@
{{ . | replaceRE "(<h[2-9] id=\"([^\"]+)\".+)(</h[2-9]+>)" `${1}<a href="#${2}" class="anchor" aria-hidden="true">#</a> ${3}` | safeHTML }}