button: cleanup #1008

This commit is contained in:
Sören Weber 2025-02-07 22:15:38 +01:00
parent 109d094dc2
commit 881931eb11
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 9 additions and 11 deletions

View file

@ -24,8 +24,6 @@
{{- else if not $href }}
{{- else }}
{{- $isLink = true }}
{{- /* target will be boolean false if no user defined value was set and effect default should be applied */}}
{{- $target := false }}
{{- $u := urls.Parse .href }}
{{- if $u.IsAbs }}
{{- partialCached "_relearn/urlExists.gotmpl" (dict "url" .href "page" $page "type" "link") $u.String }}
@ -58,15 +56,15 @@
<button onclick="{{ $href | safeJS }}"{{ if gt (len $type) 0 }} type="{{ $type }}"{{ end }}>
{{- else if $isLink -}}
<a
{{- range $k, $v := $attributes }}
{{- if $v }}
{{- if eq (printf "%T" $v) "bool" }}
{{- printf " %s" $k | safeHTMLAttr }}
{{- else }}
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- range $k, $v := $attributes }}
{{- if $v }}
{{- if eq (printf "%T" $v) "bool" }}
{{- printf " %s" $k | safeHTMLAttr }}
{{- else }}
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}>
{{- end }}>
{{- else -}}
<span>
{{- end }}

View file

@ -1 +1 @@
7.3.2+72099590d4409d0086ea4b9f6f3188e6847028e6
7.3.2+109d094dc2ee4e311e20da415bc8d18c1424dc75