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