diff --git a/doc/template.html b/doc/template.html
index 0538d42a68e2f3..fb334852aba434 100644
--- a/doc/template.html
+++ b/doc/template.html
@@ -70,7 +70,7 @@
+
__CONTENT__
diff --git a/tools/doc/allhtml.mjs b/tools/doc/allhtml.mjs
index cdf7140f728469..ccf3a10ea7f95b 100644
--- a/tools/doc/allhtml.mjs
+++ b/tools/doc/allhtml.mjs
@@ -27,7 +27,7 @@ for (const link of toc.match(/
/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('');
all = all.slice(0, apiStart.index + apiStart[0].length)
.replace(