Files
FixIt/layouts/_shortcodes/tab.html
T
Cell fe129dd207 feat: add APlayer shortcode and audio support (#650)
* docs: improve error message clarity for shortcode parent block validation

* feat: add APlayer shortcode and audio support

* feat: support both APlayer and MetingJS

* feat: initialize APlayer when content decrypted
2025-10-21 15:47:04 +08:00

19 lines
920 B
HTML

{{- with $.Parent -}}
{{- if ne $.Parent.Name "tabs" -}}
{{- errorf "Found shortcode %q enclosed inside a %q block, must be enclosed inside a %q block. Error position: %s" $.Name $.Parent.Name "tabs" $.Position -}}
{{- end -}}
{{- else -}}
{{- errorf "The shortcode %q must be enclosed inside a %q block, but no parent block was found. Error position: %s" $.Name "tabs" $.Position -}}
{{- end -}}
{{- $id := dict "Page" .Page | partial "function/id.html" -}}
{{- $title := .Get "title" -}}
{{- .Parent.Store.Add "tabs" (slice (dict "title" $title "id" $id)) -}}
{{- $content := trim .Inner "\r\n" -}}
{{- /* Remove p tags around complete tab-container structure */ -}}
{{- $content = $content | replaceRE `<p>(<tab-container[^>]*>[\s\S]*?</button>)</p>` "$1" -}}
{{- /* Tab panel */ -}}
<div role="tabpanel" aria-labelledby="tab-{{ $id }}" class="tab-panel">{{ $content | safeHTML }}</div>
{{- /* EOF */ -}}