style(anchored_headings): refactor for better readability

This commit is contained in:
Aditya Telange
2026-05-03 12:47:11 +05:30
parent e15621f499
commit f82488f1f9
+5 -1
View File
@@ -1,2 +1,6 @@
{{- /* formats .Content headings by adding an anchor */ -}} {{- /* formats .Content headings by adding an anchor */ -}}
{{ . | replaceRE "(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)" "${1}<a hidden class=\"anchor\" aria-hidden=\"true\" href=\"#${2}\">#</a>${3}" | safeHTML }} {{ . | replaceRE
"(<h[1-6] id=\"([^\"]+)\".+)(</h[1-6]+>)"
"${1}<a hidden class=\"anchor\" aria-hidden=\"true\" href=\"#${2}\">#</a>${3}"
| safeHTML
}}