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
{{% 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.

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" }
```
{{%/* /tab */%}}
{{%/* tab name="XML" */%}}
{{%/* tab name="_**XML**_ stuff" */%}}
```xml
<Hello>World</Hello>
```
@ -117,7 +117,7 @@ Hello = World
{ "Hello": "World" }
```
{{%/* /tab */%}}
{{%/* tab name="XML" */%}}
{{%/* tab name="XML stuff" */%}}
```xml
<Hello>World</Hello>
```
@ -133,7 +133,7 @@ Hello = World
{ "Hello": "World" }
```
{{%/* /tab */%}}
{{%/* tab name="XML" */%}}
{{%/* tab name="XML stuff" */%}}
```xml
<Hello>World</Hello>
```
@ -152,7 +152,7 @@ Hello = World
{ "Hello": "World" }
```
{{% /tab %}}
{{% tab name="XML" %}}
{{% tab name="_**XML**_ stuff" %}}
```xml
<Hello>World</Hello>
```
@ -172,7 +172,7 @@ Hello = World
{ "Hello": "World" }
```
{{% /tab %}}
{{% tab name="XML" %}}
{{% tab name="XML stuff" %}}
```xml
<Hello>World</Hello>
```
@ -187,7 +187,7 @@ Hello = World
{ "Hello": "World" }
```
{{% /tab %}}
{{% tab name="XML" %}}
{{% tab name="XML stuff" %}}
```xml
<Hello>World</Hello>
```

View file

@ -6,17 +6,17 @@
<div class="tab-nav">
{{- range $idx, $tab := $tabs }}
<button
data-tab-item="{{ .name }}"
data-tab-item="{{ .name | markdownify | plainify }}"
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 }}
</div>
<div class="tab-content">
{{- range $idx, $tab := $tabs }}
<div
data-tab-item="{{ .name }}"
data-tab-item="{{ .name | markdownify | plainify }}"
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 ? -->