Chomp trailing newline in shortcodes.
This commit is contained in:
parent
6ef0b26e1c
commit
5bc5ce9a58
5 changed files with 5 additions and 2 deletions
|
|
@ -3,3 +3,4 @@
|
|||
{{ $src := .Get "src" -}}
|
||||
{{ $text := .Get "text" -}}
|
||||
<a class="button{{ with $class }} {{ . }}{{ end }}" href="{{ $src }}"{{ if $newtab }} target="_blank" rel="noopener noreferrer"{{ end }}>{{ $text }}</a>
|
||||
{{- /* chomp trailing newline */ -}}
|
||||
|
|
|
|||
|
|
@ -34,3 +34,4 @@
|
|||
{{ end -}}
|
||||
|
||||
<a class="file{{ with $class }} {{ . }}{{ end }}" href="{{ $src }}"{{ if $newtab }} target="_blank" rel="noopener noreferrer"{{ end }}>{{ $text }}</a>
|
||||
{{- /* chomp trailing newline */ -}}
|
||||
|
|
|
|||
|
|
@ -91,4 +91,4 @@
|
|||
|
||||
{{ with $link }}<a class="image-link" href="{{ . }}">{{ end -}}
|
||||
<img class="image{{ with $class }} {{ . }}{{ end }}" src="{{ $src }}" loading="lazy"{{ with $srcsetw }} srcset="{{ delimit . ", " }}"{{ end }}{{ if isset .Params "alt" }} alt="{{ $alt }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}>
|
||||
{{- if $link }}</a>{{ end }}
|
||||
{{- if $link }}</a>{{ end -}}
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
${{ .Inner }}$
|
||||
{{- /* chomp trailing newline */ -}}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{{ with site.GetPage (.Get 0) }}<a href="{{ .RelPermalink }}">{{ .Title }}</a>{{ end }}
|
||||
{{ with site.GetPage (.Get 0) }}<a href="{{ .RelPermalink }}">{{ .Title }}</a>{{ end -}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue