fix(docs): use replaceAll in the doc-section TOC slug helper

Satisfies unicorn/prefer-string-replace-all (global-regex replace -> replaceAll).
This commit is contained in:
2026-06-08 16:28:52 +07:00
parent c2252a2a5c
commit 67ca9252b7
+2 -2
View File
@@ -32,8 +32,8 @@ function buildDocToc() {
if (!h.id) {
h.id = (h.textContent ?? '')
.toLowerCase().trim()
.replace(/[^a-z0-9]+/g, '-')
.replace(/(^-|-$)/g, '');
.replaceAll(/[^a-z0-9]+/g, '-')
.replaceAll(/(^-|-$)/g, '');
}
return { id: h.id, text: h.textContent ?? '', depth: h.tagName === 'H2' ? 2 : 3 };
});