diff options
author | Robert Kaussow <mail@thegeeklab.de> | 2022-06-24 11:54:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-24 11:54:16 +0300 |
commit | 580ea885e3927d5023b3a3bfa4a3178652b246b7 (patch) | |
tree | 283974db80d13d6e44b3bae52df79255dbb0da78 | |
parent | 09bb615cfc8c9c0667b22067a0e5b422fc255136 (diff) |
fix: fix broken rendering of nested buttons (#443)
-rw-r--r-- | layouts/shortcodes/button.html | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html index 58f1eb8..fb87840 100644 --- a/layouts/shortcodes/button.html +++ b/layouts/shortcodes/button.html @@ -1,26 +1,26 @@ -{{ $ref := "" }} -{{ $target := "" }} -{{ $size := default "regular" (.Get "size" | lower) }} +{{- $ref := "" }} +{{- $target := "" }} +{{- $size := default "regular" (.Get "size" | lower) }} -{{ if not (in (slice "regular" "large") $size) }} - {{ $size = "regular" }} -{{ end }} +{{- if not (in (slice "regular" "large") $size) }} + {{- $size = "regular" }} +{{- end }} -{{ with .Get "href" }} - {{ $ref = . }} - {{ $target = "_blank" }} -{{ end }} +{{- with .Get "href" }} + {{- $ref = . }} + {{- $target = "_blank" }} +{{- end }} -{{ with .Get "relref" }} - {{ $ref = relref $ . }} -{{ end }} +{{- with .Get "relref" }} + {{- $ref = relref $ . }} +{{- end }} <span class="gdoc-button gdoc-button--{{ $size }}{{ with .Get "class" }}{{ . }}{{ end }}"> <a - {{ with $ref }}href="{{ . }}"{{ end }} - {{ with $target }}target="{{ . }}"{{ end }} class="gdoc-button__link" + {{- with $ref }}{{ printf " href=\"%s\"" . | safeHTMLAttr }}{{ end }} + {{- with $target }}{{ printf " target=\"%s\"" . | safeHTMLAttr }}{{ end }} > {{ $.Inner }} </a> |