mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-10 00:12:09 +00:00
a11y: more descriptive noteref link names
This commit is contained in:
parent
3cd44b2ce5
commit
80317aa256
1 changed files with 4 additions and 1 deletions
|
@ -23,6 +23,9 @@
|
||||||
</ol>
|
</ol>
|
||||||
</section>` -}}
|
</section>` -}}
|
||||||
|
|
||||||
|
{{- $badNoteRef := ` role="doc-noteref">([0-9]*)</a>` -}}
|
||||||
|
{{- $goodNoteRef := ` role="doc-noteref">note ${1}</a>` -}}
|
||||||
|
|
||||||
<!--Remove deprecated DPUB-ARIA role and unused classes-->
|
<!--Remove deprecated DPUB-ARIA role and unused classes-->
|
||||||
{{- $endnote := `(role="doc-endnote"|class="footnote-(back)?ref")` -}}
|
{{- $endnote := `(role="doc-endnote"|class="footnote-(back)?ref")` -}}
|
||||||
{{- $noEndnote := printf "" -}}
|
{{- $noEndnote := printf "" -}}
|
||||||
|
@ -38,4 +41,4 @@
|
||||||
{{- $repeatedFootnoteBacklinksBad := `<a href="#fnref([0-9]):([0-9]*)"(.*role="doc-backlink"(?:.*)?)>` -}}
|
{{- $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}>` -}}
|
{{- $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 $endnotesClosingDiv $endnotesClosingSection | replaceRE $endnote $noEndnote | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | replaceRE $repeatedFootnoteBacklinksBad $repeatedFootnoteBacklinksGood | safeHTML -}}
|
{{- .Content | replaceRE $referencesWithoutHeading $referencesWithHeading | replaceRE $badNoteRef $goodNoteRef | replaceRE $endnotesClosingDiv $endnotesClosingSection | replaceRE $endnote $noEndnote | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | replaceRE $repeatedFootnoteBacklinksBad $repeatedFootnoteBacklinksGood | safeHTML -}}
|
||||||
|
|
Loading…
Reference in a new issue