mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-01 18:32:52 +02:00
refactor: various TOC improvements (#5627)
This commit is contained in:
parent
725e7e3da1
commit
4dbc458a22
5 changed files with 13 additions and 13 deletions
|
@ -38,11 +38,12 @@ function getAnchors({
|
|||
}) {
|
||||
const selectors = [];
|
||||
for (let i = minHeadingLevel; i <= maxHeadingLevel; i += 1) {
|
||||
selectors.push(`.anchor.anchor__h${i}`);
|
||||
selectors.push(`h${i}.anchor`);
|
||||
}
|
||||
const selector = selectors.join(', ');
|
||||
|
||||
return Array.from(document.querySelectorAll(selector)) as HTMLElement[];
|
||||
return Array.from(
|
||||
document.querySelectorAll(selectors.join()),
|
||||
) as HTMLElement[];
|
||||
}
|
||||
|
||||
function getActiveAnchor(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue