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

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

%s

` ($heading) -}} {{ $endnote := `(role="doc-endnote")` }} {{ $noEndnote := printf "" }} {{ .Content | replaceRE $references $referencesWithHeading | replaceRE $endnote $noEndnote | safeHTML -}} {{ else -}} {{ .Content -}} {{ end -}}