tags: allow markdown in tab name #538

This commit is contained in:
Sören Weber 2023-05-25 13:17:16 +02:00
parent 547da8e919
commit 2b789843bb
No known key found for this signature in database
GPG Key ID: BEC6D55545451B6D
3 changed files with 11 additions and 11 deletions

View File

@ -67,7 +67,7 @@ printf("Hello World!");
### Mixed content ### Mixed content
{{% tab name="Mixed" %}} {{% tab name="_**Mixed**_" %}}
A tab can not only contain code but arbitrary text. In this case text and code will get a margin. A tab can not only contain code but arbitrary text. In this case text and code will get a margin.

View File

@ -96,7 +96,7 @@ While pressing a tab of group A switches all tab views of group A in sync (if th
{ "Hello": "World" } { "Hello": "World" }
``` ```
{{%/* /tab */%}} {{%/* /tab */%}}
{{%/* tab name="XML" */%}} {{%/* tab name="_**XML**_ stuff" */%}}
```xml ```xml
<Hello>World</Hello> <Hello>World</Hello>
``` ```
@ -117,7 +117,7 @@ Hello = World
{ "Hello": "World" } { "Hello": "World" }
``` ```
{{%/* /tab */%}} {{%/* /tab */%}}
{{%/* tab name="XML" */%}} {{%/* tab name="XML stuff" */%}}
```xml ```xml
<Hello>World</Hello> <Hello>World</Hello>
``` ```
@ -133,7 +133,7 @@ Hello = World
{ "Hello": "World" } { "Hello": "World" }
``` ```
{{%/* /tab */%}} {{%/* /tab */%}}
{{%/* tab name="XML" */%}} {{%/* tab name="XML stuff" */%}}
```xml ```xml
<Hello>World</Hello> <Hello>World</Hello>
``` ```
@ -152,7 +152,7 @@ Hello = World
{ "Hello": "World" } { "Hello": "World" }
``` ```
{{% /tab %}} {{% /tab %}}
{{% tab name="XML" %}} {{% tab name="_**XML**_ stuff" %}}
```xml ```xml
<Hello>World</Hello> <Hello>World</Hello>
``` ```
@ -172,7 +172,7 @@ Hello = World
{ "Hello": "World" } { "Hello": "World" }
``` ```
{{% /tab %}} {{% /tab %}}
{{% tab name="XML" %}} {{% tab name="XML stuff" %}}
```xml ```xml
<Hello>World</Hello> <Hello>World</Hello>
``` ```
@ -187,7 +187,7 @@ Hello = World
{ "Hello": "World" } { "Hello": "World" }
``` ```
{{% /tab %}} {{% /tab %}}
{{% tab name="XML" %}} {{% tab name="XML stuff" %}}
```xml ```xml
<Hello>World</Hello> <Hello>World</Hello>
``` ```

View File

@ -6,17 +6,17 @@
<div class="tab-nav"> <div class="tab-nav">
{{- range $idx, $tab := $tabs }} {{- range $idx, $tab := $tabs }}
<button <button
data-tab-item="{{ .name }}" data-tab-item="{{ .name | markdownify | plainify }}"
class="tab-nav-button{{ cond (eq $idx 0) " active" ""}}" class="tab-nav-button{{ cond (eq $idx 0) " active" ""}}"
onclick="switchTab('{{ $groupid }}','{{ .name }}')" onclick="switchTab('{{ $groupid }}','{{ .name | markdownify | plainify}}')"
> >
<span>{{ .name }}</span></button> <span>{{ .name | markdownify }}</span></button>
{{- end }} {{- end }}
</div> </div>
<div class="tab-content"> <div class="tab-content">
{{- range $idx, $tab := $tabs }} {{- range $idx, $tab := $tabs }}
<div <div
data-tab-item="{{ .name }}" data-tab-item="{{ .name | markdownify | plainify }}"
class="tab-content-text{{ cond (eq $idx 0) " active" ""}}" class="tab-content-text{{ cond (eq $idx 0) " active" ""}}"
> >
{{ .content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? --> {{ .content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->