Skip to content

Commit

Permalink
Merge pull request #2562 from w3c/fix/errata-text
Browse files Browse the repository at this point in the history
Fix errata link text
  • Loading branch information
mattgarrish committed May 19, 2023
2 parents 12b3ac1 + 06ff243 commit 1402124
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 10 deletions.
4 changes: 3 additions & 1 deletion epub33/a11y-tech/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<title>EPUB Accessibility Techniques 1.1</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script src="../common/js/fix-errata.js" class="remove"></script>
<script src="../common/js/copyright.js" class="remove"></script>
<script class="remove">
var respecConfig = {
Expand Down Expand Up @@ -97,7 +98,8 @@
"href": "https://www.w3.org/TR/WCAG2/",
"publisher": "W3C"
}
}
},
postProcess: [fixErrataField]
};</script>
<style>
pre {
Expand Down
3 changes: 2 additions & 1 deletion epub33/a11y/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<title>EPUB Accessibility 1.1</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script src="../common/js/fix-errata.js" class="remove"></script>
<script src="../common/js/css-inline.js" class="remove"></script>
<script src="../common/js/data-test-display.js" class="remove"></script>
<script src="../common/js/copyright.js" class="remove"></script>
Expand Down Expand Up @@ -106,7 +107,7 @@
}
},
preProcess:[inlineCustomCSS],
postProcess: [data_test_display],
postProcess: [data_test_display, fixErrataField],
otherLinks: [
{
key: "This document is also available in this non-normative format:",
Expand Down
18 changes: 18 additions & 0 deletions epub33/common/js/fix-errata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

function fixErrataField() {

var errataLink = 'https://w3c.github.io/epub-specs/epub33/errata.html';

var errataField = document.querySelector('div.head > details > dl > dd > a[href="' + errataLink + '"]');

if (!errataField) {
console.log('Errata field not found. Unable to repair link.');
}

else {
errataField.innerHTML = errataLink;

// remove trailing period
errataField.parentNode.innerHTML = errataField.parentNode.innerHTML.replace(/\.\s*$/,'');
}
}
3 changes: 2 additions & 1 deletion epub33/core/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<title>EPUB 3.3</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script src="./biblio.js" class="remove"></script>
<script src="../common/js/fix-errata.js" class="remove"></script>
<script src="../common/js/css-inline.js" class="remove"></script>
<script src="../common/js/add-caution-hd.js" class="remove"></script>
<script src="../common/js/data-test-display.js" class="remove"></script>
Expand Down Expand Up @@ -53,7 +54,7 @@
},
localBiblio: biblio,
preProcess:[inlineCustomCSS],
postProcess:[addCautionHeaders,data_test_display],
postProcess:[addCautionHeaders, data_test_display, fixErrataField],
testSuiteURI: "https://w3c.github.io/epub-tests/index.html",
lint: {
"wpt-tests-exist": true,
Expand Down
4 changes: 3 additions & 1 deletion epub33/epub-a11y-eaa-mapping/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<title>EPUB Accessibility - EU Accessibility Act Mapping</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script src="../common/js/fix-errata.js" class="remove"></script>
<script src="../common/js/css-inline.js" class="remove"></script>
<script class="remove">
var respecConfig = {
Expand Down Expand Up @@ -40,7 +41,8 @@
github: {
repoURL: "https://github.com/w3c/epub-specs",
branch: "main"
}
},
postProcess: [fixErrataField]
};
</script>
<style>
Expand Down
4 changes: 3 additions & 1 deletion epub33/epub-aria-authoring/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<title>EPUB Type to ARIA Role Authoring Guide 1.1</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove" defer="defer"></script>
<script src="../common/js/fix-errata.js" class="remove"></script>
<script src="../common/js/css-inline.js" class="remove"></script>
<script src="../common/js/copyright.js" class="remove"></script>
<script class="remove">
Expand Down Expand Up @@ -46,7 +47,8 @@
"url": "https://www.w3.org/TR/wai-aria/",
"publisher": "W3C"
}
}
},
postProcess: [removeEmptyIndex]
};
</script>
<style>
Expand Down
4 changes: 3 additions & 1 deletion epub33/multi-rend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<title>EPUB 3 Multiple-Rendition Publications 1.1</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script src="../common/js/fix-errata.js" class="remove"></script>
<script src="../common/js/css-inline.js" class="remove"></script>
<script src="../common/js/copyright.js" class="remove"></script>
<script class="remove">
Expand Down Expand Up @@ -69,7 +70,8 @@
profile: "web-platform",
specs: ["epub-rs-33","epub-33"]
},
preProcess:[inlineCustomCSS]
preProcess:[inlineCustomCSS],
postProcess: [fixErrataField]
};//]]>
</script>
</head>
Expand Down
3 changes: 2 additions & 1 deletion epub33/overview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script src="./biblio.js" class="remove"></script>
<script src="../common/js/add-caution-hd.js" class="remove"></script>
<script src="../common/js/fix-errata.js" class="remove"></script>
<script src="../common/js/css-inline.js" class="remove"></script>
<script src="../common/js/remove-empty-index.js" class="remove"></script>
<script src="../common/js/copyright.js" class="remove"></script>
Expand Down Expand Up @@ -49,7 +50,7 @@
},
localBiblio: biblio,
preProcess:[inlineCustomCSS],
postProcess: [removeEmptyIndex]
postProcess: [removeEmptyIndex,fixErrataField]
};</script>
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion epub33/rs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<title>EPUB Reading Systems 3.3</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script src="../common/js/fix-errata.js" class="remove"></script>
<script src="../common/js/css-inline.js" class="remove"></script>
<script src="../common/js/data-test-display.js" class="remove"></script>
<script src="../common/js/copyright.js" class="remove"></script>
Expand Down Expand Up @@ -108,7 +109,7 @@
},
},
preProcess:[inlineCustomCSS],
postProcess: [data_test_display],
postProcess: [data_test_display, fixErrataField],
testSuiteURI: "https://w3c.github.io/epub-tests/index.html",
lint: {
"wpt-tests-exist": true,
Expand Down
4 changes: 3 additions & 1 deletion epub33/ssv/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<title>EPUB 3 Structural Semantics Vocabulary 1.1</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove" defer=""></script>
<script src="../common/js/fix-errata.js" class="remove"></script>
<script src="../common/js/css-inline.js" class="remove"></script>
<script src="../common/js/copyright.js" class="remove"></script>
<script class="remove">
Expand Down Expand Up @@ -92,7 +93,8 @@
profile: "web-platform",
specs: ["epub-rs-33","epub-33"]
},
preProcess:[inlineCustomCSS]
preProcess:[inlineCustomCSS],
postProcess: [fixErrataField]
};//]]>
</script>
<style>
Expand Down
4 changes: 3 additions & 1 deletion epub33/tts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8" />
<title>EPUB 3 Text-to-Speech Enhancements 1.0</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove" defer=""></script>
<script src="../common/js/fix-errata.js" class="remove"></script>
<script src="../common/js/css-inline.js" class="remove"></script>
<script src="../common/js/copyright.js" class="remove"></script>
<script class="remove">
Expand Down Expand Up @@ -53,7 +54,8 @@
profile: "web-platform",
specs: ["epub-rs-33","epub-33"]
},
preProcess:[inlineCustomCSS]
preProcess:[inlineCustomCSS],
postProcess: [fixErrataField]
};//]]>
</script>
</head>
Expand Down

0 comments on commit 1402124

Please sign in to comment.