1
0
mirror of https://gitlab.com/MisterBiggs/brain-quartz.git synced 2025-07-22 14:21:24 +00:00

feat: copyable header anchors (fixes #86)

This commit is contained in:
Jacky Zhao
2022-04-30 13:10:12 -07:00
parent ec86cca97b
commit b8a660e208
2 changed files with 17 additions and 0 deletions

View File

@@ -53,4 +53,8 @@
{{end}}
{{end}}
{{end}}
{{/* Add copyable anchors */}}
{{ $content = $content | replaceRE "(<h[1-9] id=\"([^\"]+)\">)(.+)(</h[1-9]>)" `<a href="#${2}">${1}<span class="hanchor" ariaLabel="Anchor"># </span>${3}${4}</a>` }}
{{ $content | safeHTML }}