aboutsummaryrefslogtreecommitdiff
path: root/docs/dev/articles/mkin_files/accessible-code-block-0.0.1/empty-anchor.js
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-02-08 17:17:29 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2022-02-08 17:17:29 +0100
commit0fa8a770812775d697717ad723f7f61fb04b7fef (patch)
tree17473ddf787541745d47dab063bc643ec59a9557 /docs/dev/articles/mkin_files/accessible-code-block-0.0.1/empty-anchor.js
parentd081384ddcb75a9f92fad33e4e3f6d6796f98e67 (diff)
parentc0638c84568d475b3b059e2c6e593e6f03b846bc (diff)
Merge branch 'nlmixr'
Diffstat (limited to 'docs/dev/articles/mkin_files/accessible-code-block-0.0.1/empty-anchor.js')
-rw-r--r--docs/dev/articles/mkin_files/accessible-code-block-0.0.1/empty-anchor.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/dev/articles/mkin_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/dev/articles/mkin_files/accessible-code-block-0.0.1/empty-anchor.js
new file mode 100644
index 00000000..ca349fd6
--- /dev/null
+++ b/docs/dev/articles/mkin_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');
+ }
+ }
+ }
+});

Contact - Imprint