Improve consistency of handling shrotcode attributes
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
{{- /* remove whitespaces */ -}}
|
||||
<details {{ if or (.Get "open") (in .Params "open") }}open{{ end }}>
|
||||
{{- $attributes := partial "docs/text/mapper" (dict
|
||||
"attributes" (cond .IsNamedParams .Params dict)
|
||||
"merge" (dict
|
||||
"open" (cond .IsNamedParams (.Get "open") (in .Params "open"))
|
||||
)
|
||||
) -}}
|
||||
<details {{ partial "docs/html-attrs" $attributes | safeHTMLAttr }}>
|
||||
{{- $summary := cond .IsNamedParams (.Get "title") (.Get 0) -}}
|
||||
<summary>{{ $summary | .Page.RenderString }}</summary>
|
||||
{{- /* remove whitespaces */ -}}
|
||||
|
||||
Reference in New Issue
Block a user