mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
doc: add main ARIA landmark to API docs
As an accessibility improvement, specify the main landmark for the column in our docs that contains the main content. Ref: https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/ Ref: https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA20.html PR-URL: https://github.com/nodejs/node/pull/49882 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Claudio Wunder <cwunder@gnome.org> Reviewed-By: LiviaMedeiros <livia@cirno.name>
This commit is contained in:
parent
f416a0f555
commit
bc056c2426
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
__TOC__
|
||||
|
||||
<div id="apicontent">
|
||||
<div role="main" id="apicontent">
|
||||
__CONTENT__
|
||||
<!-- API END -->
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ for (const link of toc.match(/<a.*?>/g)) {
|
|||
const data = fs.readFileSync(new URL(`./${href}`, source), 'utf8');
|
||||
|
||||
// Split the doc.
|
||||
const match = /(<\/ul>\s*)?<\/\w+>\s*<\w+ id="apicontent">/.exec(data);
|
||||
const match = /(<\/ul>\s*)?<\/\w+>\s*<\w+ role="main" id="apicontent">/.exec(data);
|
||||
|
||||
// Get module name
|
||||
const moduleName = href.replace(/\.html$/, '');
|
||||
|
|
@ -89,7 +89,7 @@ all = all.slice(0, tocStart.index + tocStart[0].length) +
|
|||
all.slice(tocStart.index + tocStart[0].length);
|
||||
|
||||
// Replace apicontent with the concatenated set of apicontents from each source.
|
||||
const apiStart = /<\w+ id="apicontent">\s*/.exec(all);
|
||||
const apiStart = /<\w+ role="main" id="apicontent">\s*/.exec(all);
|
||||
const apiEnd = all.lastIndexOf('<!-- API END -->');
|
||||
all = all.slice(0, apiStart.index + apiStart[0].length)
|
||||
.replace(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user