diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 569016d3..245ba8e6 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -879,6 +879,7 @@ The `tabs` shortcode is commonly used to present different variants of a particu | `default` | **Optional.** Label of the tab to be active by default. If not set, the first tab will be active. | | `label` | **Required.** The text label displayed on the tab button. | | `icon` | **Optional.** Icon name to display before the label. | +| `md` | **Optional.** Render tab content as Markdown (default `true`). Set `md=false` to allow nested shortcodes inside tab content. | **Example 1: Basic Usage** @@ -905,8 +906,8 @@ The `tabs` shortcode is commonly used to present different variants of a particu ``` {{* /tab */>}} - {{* tab label="Linux" */>}} - See [documentation](https://code.visualstudio.com/docs/setup/linux#_install-vs-code-on-linux). + {{* tab label="Linux" md=false */>}} + {{* alert */>}}See [documentation](https://code.visualstudio.com/docs/setup/linux#_install-vs-code-on-linux).{{* /alert */>}} {{* /tab */>}} {{* /tabs */>}} @@ -936,8 +937,8 @@ The `tabs` shortcode is commonly used to present different variants of a particu ``` {{< /tab >}} - {{< tab label="Linux" >}} - See [documentation](https://code.visualstudio.com/docs/setup/linux#_install-vs-code-on-linux). + {{< tab label="Linux" md=false >}} + {{< alert >}}See [documentation](https://code.visualstudio.com/docs/setup/linux#_install-vs-code-on-linux).{{< /alert >}} {{< /tab >}} {{< /tabs >}} 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 -}}