mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 10:50:24 +00:00
shortcodes: correctly detect empty shortcode content #966
This commit is contained in:
parent
19ea877181
commit
bd1f3d3432
3 changed files with 3 additions and 3 deletions
|
@ -8,7 +8,7 @@
|
||||||
{{- $containerclass := .containerclass | default slice | append "box-content" }}
|
{{- $containerclass := .containerclass | default slice | append "box-content" }}
|
||||||
{{- $color := .color | default "" }}
|
{{- $color := .color | default "" }}
|
||||||
{{- $content := trim .content "\n\r\t " }}
|
{{- $content := trim .content "\n\r\t " }}
|
||||||
{{- $hasContent := ne (strings.TrimLeft "<p>" $content) "" }}
|
{{- $hasContent := ne (strings.TrimPrefix "<p>" $content) "" }}
|
||||||
{{- if not (hasPrefix $content "<") }}
|
{{- if not (hasPrefix $content "<") }}
|
||||||
{{- $content = printf "<p>\n%s" $content }}
|
{{- $content = printf "<p>\n%s" $content }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
{{- with $tab }}
|
{{- with $tab }}
|
||||||
{{- $color := .color | default $color | default "" }}
|
{{- $color := .color | default $color | default "" }}
|
||||||
{{- $content := trim .content "\n\r\t " }}
|
{{- $content := trim .content "\n\r\t " }}
|
||||||
{{- $hasContent := ne (strings.TrimLeft "<p>" $content) "" }}
|
{{- $hasContent := ne (strings.TrimPrefix "<p>" $content) "" }}
|
||||||
{{- if not (hasPrefix $content "<") }}
|
{{- if not (hasPrefix $content "<") }}
|
||||||
{{- $content = printf "<p>\n%s" $content }}
|
{{- $content = printf "<p>\n%s" $content }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
7.2.0+914b5f5a1b1a5c7a7b611276b9c029ee31f1e162
|
7.2.0+19ea877181e2ca631fdb30e2abf1418d314c25e4
|
Loading…
Reference in a new issue