2021-01-17 17:18:02 -08:00
|
|
|
{{ if .Params.footnote_heading -}}
|
2022-04-05 21:41:08 -07:00
|
|
|
|
2021-01-17 19:42:07 -08:00
|
|
|
{{ $references := `(<section class="footnotes" role="doc-endnotes">
|
|
|
|
<hr>)` -}}
|
2022-04-05 21:41:08 -07:00
|
|
|
{{ $heading := .Params.footnote_heading -}}
|
2022-04-06 17:49:25 -07:00
|
|
|
{{ $referencesWithHeading := printf `<section role="doc-endnotes" aria-labelledby="note-hd">
|
2021-01-17 19:42:07 -08:00
|
|
|
<h2 id="note-hd">%s</h2>` ($heading) -}}
|
2022-04-05 21:41:08 -07:00
|
|
|
|
|
|
|
{{ $endnote := `(role="doc-endnote")` }}
|
|
|
|
{{ $noEndnote := printf "" }}
|
2022-04-06 17:49:25 -07:00
|
|
|
|
|
|
|
{{ $preWithTabIndex := `<pre tabindex="0">` }}
|
|
|
|
{{ $preWithoutTabIndex := `<pre>` }}
|
|
|
|
|
|
|
|
{{ .Content | replaceRE $references $referencesWithHeading | replaceRE $endnote $noEndnote | replaceRE $preWithTabIndex $preWithoutTabIndex | safeHTML -}}
|
2021-01-17 19:42:07 -08:00
|
|
|
{{ else -}}
|
|
|
|
{{ .Content -}}
|
2021-01-17 17:18:02 -08:00
|
|
|
{{ end -}}
|