From bd1f3d3432632c61bb12e7ec0f7673fed0289f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Mon, 9 Dec 2024 18:53:02 +0100 Subject: [PATCH] shortcodes: correctly detect empty shortcode content #966 --- layouts/partials/shortcodes/notice.html | 2 +- layouts/partials/shortcodes/tabs.html | 2 +- layouts/partials/version.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/partials/shortcodes/notice.html b/layouts/partials/shortcodes/notice.html index 0ebae91dc4..3f64aea7aa 100644 --- a/layouts/partials/shortcodes/notice.html +++ b/layouts/partials/shortcodes/notice.html @@ -8,7 +8,7 @@ {{- $containerclass := .containerclass | default slice | append "box-content" }} {{- $color := .color | default "" }} {{- $content := trim .content "\n\r\t " }} -{{- $hasContent := ne (strings.TrimLeft "

" $content) "" }} +{{- $hasContent := ne (strings.TrimPrefix "

" $content) "" }} {{- if not (hasPrefix $content "<") }} {{- $content = printf "

\n%s" $content }} {{- end }} diff --git a/layouts/partials/shortcodes/tabs.html b/layouts/partials/shortcodes/tabs.html index 87da7e4626..de054230af 100644 --- a/layouts/partials/shortcodes/tabs.html +++ b/layouts/partials/shortcodes/tabs.html @@ -17,7 +17,7 @@ {{- with $tab }} {{- $color := .color | default $color | default "" }} {{- $content := trim .content "\n\r\t " }} - {{- $hasContent := ne (strings.TrimLeft "

" $content) "" }} + {{- $hasContent := ne (strings.TrimPrefix "

" $content) "" }} {{- if not (hasPrefix $content "<") }} {{- $content = printf "

\n%s" $content }} {{- end }} diff --git a/layouts/partials/version.txt b/layouts/partials/version.txt index 3ed0c34486..904cd3af2a 100644 --- a/layouts/partials/version.txt +++ b/layouts/partials/version.txt @@ -1 +1 @@ -7.2.0+914b5f5a1b1a5c7a7b611276b9c029ee31f1e162 \ No newline at end of file +7.2.0+19ea877181e2ca631fdb30e2abf1418d314c25e4 \ No newline at end of file