{{ if .Params.footnote_heading -}} {{ $references := `(

)` -}} {{ $heading := .Params.footnote_heading -}} {{ $referencesWithHeading := printf `

%s

` ($heading) -}} {{ $endnote := `(role="doc-endnote")` }} {{ $noEndnote := printf "" }} {{ $preWithTabIndex := `
` }}
{{ $preWithoutTabIndex := `
` }}

{{ .Content | replaceRE $references $referencesWithHeading | replaceRE $endnote $noEndnote | replaceRE $preWithTabIndex $preWithoutTabIndex | safeHTML -}}
{{ else -}}
{{ .Content -}}
{{ end -}}