diff --git a/tools/doc/allhtml.mjs b/tools/doc/allhtml.mjs
index e752e117698cb1..c9f63d6d26f091 100644
--- a/tools/doc/allhtml.mjs
+++ b/tools/doc/allhtml.mjs
@@ -57,8 +57,8 @@ for (const link of toc.match(//g)) {
return ` {
- return ` {
+ return `<${tagName} id="${moduleName}_${id}"`;
})
// Prefix all links to other docs modules with those module names
.replace(/ {