Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bc056c2

Browse filesBrowse files
committed
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: #49882 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Claudio Wunder <cwunder@gnome.org> Reviewed-By: LiviaMedeiros <livia@cirno.name>
1 parent f416a0f commit bc056c2
Copy full SHA for bc056c2

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎doc/template.html‎

Copy file name to clipboardExpand all lines: doc/template.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ <h1>Node.js __VERSION__ documentation</h1>
7070

7171
__TOC__
7272

73-
<div id="apicontent">
73+
<div role="main" id="apicontent">
7474
__CONTENT__
7575
<!-- API END -->
7676
</div>
Collapse file

‎tools/doc/allhtml.mjs‎

Copy file name to clipboardExpand all lines: tools/doc/allhtml.mjs
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ for (const link of toc.match(/<a.*?>/g)) {
2727
const data = fs.readFileSync(new URL(`./${href}`, source), 'utf8');
2828

2929
// Split the doc.
30-
const match = /(<\/ul>\s*)?<\/\w+>\s*<\w+ id="apicontent">/.exec(data);
30+
const match = /(<\/ul>\s*)?<\/\w+>\s*<\w+ role="main" id="apicontent">/.exec(data);
3131

3232
// Get module name
3333
const moduleName = href.replace(/\.html$/, '');
@@ -89,7 +89,7 @@ all = all.slice(0, tocStart.index + tocStart[0].length) +
8989
all.slice(tocStart.index + tocStart[0].length);
9090

9191
// Replace apicontent with the concatenated set of apicontents from each source.
92-
const apiStart = /<\w+ id="apicontent">\s*/.exec(all);
92+
const apiStart = /<\w+ role="main" id="apicontent">\s*/.exec(all);
9393
const apiEnd = all.lastIndexOf('<!-- API END -->');
9494
all = all.slice(0, apiStart.index + apiStart[0].length)
9595
.replace(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.