From 19a4e5f5af91aeda1ef7af3dafcd7421b3138d3f Mon Sep 17 00:00:00 2001 From: Alex Haslam Date: Mon, 16 Feb 2026 09:27:51 +0000 Subject: [PATCH] Add `md` flag --- layouts/shortcodes/tab.html | 7 ++++++- layouts/shortcodes/tabs.html | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/tab.html b/layouts/shortcodes/tab.html index f2b96f2a..b4959801 100644 --- a/layouts/shortcodes/tab.html +++ b/layouts/shortcodes/tab.html @@ -1,7 +1,12 @@ {{- $label := .Get "label" -}} {{- $icon := .Get "icon" -}} {{- $index := .Parent.Store.Get "tab-index" | default 0 -}} -{{- $content := .InnerDeindent | strings.TrimSpace | .Page.RenderString -}} +{{- $md := .Get "md" | default true -}} +{{- $isMarkdown := or (eq $md true) (eq $md "true") -}} +{{- $content := .Inner -}} +{{- if $isMarkdown -}} + {{- $content = .InnerDeindent | strings.TrimSpace | .Page.RenderString -}} +{{- end -}} {{- $tabs := .Parent.Store.Get "tabs" | default slice -}} {{- .Parent.Store.Set "tabs" ($tabs | append (dict "label" $label "icon" $icon "content" $content)) -}} diff --git a/layouts/shortcodes/tabs.html b/layouts/shortcodes/tabs.html index d093855a..c219b78e 100644 --- a/layouts/shortcodes/tabs.html +++ b/layouts/shortcodes/tabs.html @@ -45,7 +45,7 @@ {{- $isActive = eq $nTabs 0 -}} {{- end -}}
- {{ index . "content" }} + {{ index . "content" | safeHTML }}
{{- end -}}