mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 21:02:09 +00:00
Give repeated footnote backrefs an accessible name
This commit is contained in:
parent
fb6e91c820
commit
f4e4128d92
1 changed files with 4 additions and 1 deletions
|
@ -25,4 +25,7 @@
|
|||
{{- $footnoteBacklinksBad := `<a href="#fnref:([0-9]*)"(.*role="doc-backlink"(?:.*)?)>` -}}
|
||||
{{- $footnoteBacklinksGood := `<a href="#fnref:${1}" title="back to reference ${1}" aria-label="back to reference ${1}"${2}>` -}}
|
||||
|
||||
{{- .Content | replaceRE $referencesWithoutHeading $referencesWithHeading | replaceRE $endnote $noEndnote | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | safeHTML -}}
|
||||
{{- $repeatedFootnoteBacklinksBad := `<a href="#fnref([0-9]):([0-9]*)"(.*role="doc-backlink"(?:.*)?)>` -}}
|
||||
{{- $repeatedFootnoteBacklinksGood := `<a href="#fnref${1}:${2}" title="back to reference ${2}, repeated instance ${1}" aria-label="back to reference ${2}, repeated instance ${1}"${3}>` -}}
|
||||
|
||||
{{- .Content | replaceRE $referencesWithoutHeading $referencesWithHeading | replaceRE $endnote $noEndnote | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | replaceRE $repeatedFootnoteBacklinksBad $repeatedFootnoteBacklinksGood | safeHTML -}}
|
||||
|
|
Loading…
Reference in a new issue