diff options
author | tdro <tdro@noreply.example.com> | 2022-07-07 04:13:18 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-07-07 04:13:18 -0400 |
commit | d42fb91ac4b4ae75c0ba02126965e71c2d8a68eb (patch) | |
tree | 36285cd115df136c3ba883e20934173e5155040c /themes/default/layouts/shortcodes | |
parent | cc21682d3b98b62b8db60f53e53910a1184fd8b3 (diff) | |
download | canory-d42fb91ac4b4ae75c0ba02126965e71c2d8a68eb.tar.gz canory-d42fb91ac4b4ae75c0ba02126965e71c2d8a68eb.tar.bz2 canory-d42fb91ac4b4ae75c0ba02126965e71c2d8a68eb.zip |
themes/default/layouts/shortcodes/mark: Allow inner blocks
Inner can contain no content with self-closing short code tags.
Diffstat (limited to 'themes/default/layouts/shortcodes')
-rw-r--r-- | themes/default/layouts/shortcodes/mark.html | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/themes/default/layouts/shortcodes/mark.html b/themes/default/layouts/shortcodes/mark.html index 02af225..122a521 100644 --- a/themes/default/layouts/shortcodes/mark.html +++ b/themes/default/layouts/shortcodes/mark.html @@ -1,5 +1,9 @@ -{{- $text := default "highligted text" (.Get "text" | default (.Get 0)) -}} -{{- $title := default $text (.Get "title" | default (.Get 1)) -}} +{{- $text := default "mark" (.Get "text" | default (.Get 0)) -}} +{{- $title := default "highlighted text" (.Get "title" | default (.Get 1)) -}} -<mark title="{{ $title }}">{{ $text }}</mark> +{{- if gt (len .Inner) 1 -}} + {{- $text = .Inner -}} +{{- end -}} + +<mark title="{{- $title -}}">{{- $text -}}</mark> {{- /* This comment removes trailing newlines and white spaces. */ -}} |