fix: fix broken rendering of nested buttons (#266)

This commit is contained in:
Robert Kaussow 2022-06-27 09:17:27 +02:00 committed by GitHub
parent 3b5c9a3a65
commit 3333560056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,25 +1,29 @@
{{ $ref := "" }} {{- $ref := "" }}
{{ $size := default "regular" (.Get "size" | lower) }} {{- $class := "" }}
{{- $size := default "regular" (.Get "size" | lower) }}
{{ if not (in (slice "regular" "large") $size) }} {{- if not (in (slice "regular" "large") $size) }}
{{ $size = "regular" }} {{- $size = "regular" }}
{{ end }} {{- end }}
{{ with .Get "href" }} {{- with .Get "href" }}
{{ $ref = . }} {{- $ref = . }}
{{ end }} {{- end }}
{{ with .Get "relref" }} {{- with .Get "relref" }}
{{ $ref = relref $ . }} {{- $ref = relref $ . }}
{{ end }} {{- end }}
{{- with .Get "class" }}
{{- $class = . }}
{{- end }}
<span <span class="gblog-button gblog-button--{{ $size }}{{ with $class }}{{ printf " %s" . }}{{ end }}">
class="gblog-button gblog-button--{{ $size }}{{ with .Get "class" }} <a
{{ printf " %s" . }} class="gblog-button__link"
{{ end }}" {{- with $ref }}{{ printf " href=\"%s\"" . | safeHTMLAttr }}{{ end }}
> >
<a {{ with $ref }}href="{{ . }}"{{ end }} class="gblog-button__link">
{{ $.Inner }} {{ $.Inner }}
</a> </a>
</span> </span>