Skip to content

Commit

Permalink
shortcodes: correctly detect empty shortcode content #966
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Dec 9, 2024
1 parent 19ea877 commit bd1f3d3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/notice.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{- $containerclass := .containerclass | default slice | append "box-content" }}
{{- $color := .color | default "" }}
{{- $content := trim .content "\n\r\t " }}
{{- $hasContent := ne (strings.TrimLeft "<p>" $content) "" }}
{{- $hasContent := ne (strings.TrimPrefix "<p>" $content) "" }}
{{- if not (hasPrefix $content "<") }}
{{- $content = printf "<p>\n%s" $content }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/shortcodes/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{{- with $tab }}
{{- $color := .color | default $color | default "" }}
{{- $content := trim .content "\n\r\t " }}
{{- $hasContent := ne (strings.TrimLeft "<p>" $content) "" }}
{{- $hasContent := ne (strings.TrimPrefix "<p>" $content) "" }}
{{- if not (hasPrefix $content "<") }}
{{- $content = printf "<p>\n%s" $content }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.2.0+914b5f5a1b1a5c7a7b611276b9c029ee31f1e162
7.2.0+19ea877181e2ca631fdb30e2abf1418d314c25e4

0 comments on commit bd1f3d3

Please sign in to comment.