mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-24 05:02:10 +00:00
76a1d8a7ca
Turns out some browsers do skip tab-selection of scrollable <pre> blocks
18 lines
649 B
HTML
18 lines
649 B
HTML
{{ if .Params.footnote_heading -}}
|
|
|
|
{{ $references := `(<section class="footnotes" role="doc-endnotes">
|
|
<hr>)` -}}
|
|
{{ $heading := .Params.footnote_heading -}}
|
|
{{ $referencesWithHeading := printf `<section role="doc-endnotes" aria-labelledby="note-hd">
|
|
<h2 id="note-hd">%s</h2>` ($heading) -}}
|
|
|
|
{{ $endnote := `(role="doc-endnote")` }}
|
|
{{ $noEndnote := printf "" }}
|
|
|
|
{{ $preWithoutTabIndex := `<pre>` }}
|
|
{{ $preWithTabIndex := `<pre tabindex="0">` }}
|
|
|
|
{{ .Content | replaceRE $references $referencesWithHeading | replaceRE $endnote $noEndnote | replaceRE $preWithoutTabIndex $preWithTabIndex | safeHTML -}}
|
|
{{ else -}}
|
|
{{ .Content -}}
|
|
{{ end -}}
|