Improve consistency of handling shrotcode attributes

This commit is contained in:
Alex Shpak
2025-10-12 13:27:05 +02:00
parent 6c9e2a1918
commit 836a8a82d6
15 changed files with 140 additions and 34 deletions
+8 -2
View File
@@ -1,8 +1,14 @@
{{- $attributes := partial "docs/text/mapper" (dict
"attributes" (cond .IsNamedParams .Params dict)
"merge" (dict
"class" "book-katex"
)
) -}}
{{- if .Inner -}}
{{- if .Get "display" -}}
<div>{{ printf "\\[ %s \\]" .Inner }}</div>
<div {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }}>{{ printf "\\[ %s \\]" .Inner }}</div>
{{- else -}}
<span>{{ printf "\\( %s \\)" .Inner }}</span>
<span {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }}>{{ printf "\\( %s \\)" .Inner }}</span>
{{- end -}}
{{- end -}}
{{- if not (.Page.Store.Get "katex") -}}