diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2021-02-15 17:05:19 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2021-02-15 17:05:19 +0100 |
commit | 11c7f26dd6c532d977d9875f3c16952c7bba37ca (patch) | |
tree | 03393f3e63f1db688166e82fff7a8d16bb239154 /docs/articles/twa_files/accessible-code-block-0.0.1/empty-anchor.js | |
parent | c4f327e62f19c0a3fc77a538f7cf0c2c619019d8 (diff) | |
parent | a9427a09abdf7ce9aaeae7c7190f90c8f2e5ef52 (diff) |
Merge branch 'master' into saemix
Diffstat (limited to 'docs/articles/twa_files/accessible-code-block-0.0.1/empty-anchor.js')
-rw-r--r-- | docs/articles/twa_files/accessible-code-block-0.0.1/empty-anchor.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/articles/twa_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/articles/twa_files/accessible-code-block-0.0.1/empty-anchor.js new file mode 100644 index 00000000..ca349fd6 --- /dev/null +++ b/docs/articles/twa_files/accessible-code-block-0.0.1/empty-anchor.js @@ -0,0 +1,15 @@ +// Hide empty <a> tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> +// v0.0.1 +// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. + +document.addEventListener('DOMContentLoaded', function() { + const codeList = document.getElementsByClassName("sourceCode"); + for (var i = 0; i < codeList.length; i++) { + var linkList = codeList[i].getElementsByTagName('a'); + for (var j = 0; j < linkList.length; j++) { + if (linkList[j].innerHTML === "") { + linkList[j].setAttribute('aria-hidden', 'true'); + } + } + } +}); |