fix(theme): remove trailing `#` from outline (#1344)

pull/1350/head
Divyansh Singh 2 years ago committed by GitHub
parent 4482c5019d
commit f1cf1e800f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,7 +20,7 @@ export function getHeaders(pageOutline: DefaultTheme.Config['outline']) {
if (el.textContent && el.id) {
updatedHeaders.push({
level: Number(el.tagName[1]),
title: el.innerText.split('\n')[0],
title: el.innerText.replace(/\s+#\s*$/, ''),
link: `#${el.id}`
})
}

Loading…
Cancel
Save