fix: include emoji text in nav link to match toc (#284)

pull/374/head
Sam Pullman 3 years ago committed by GitHub
parent 0c1a1f2ef4
commit 80ff36066e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -65,7 +65,6 @@ export const createMarkdownRenderer = (
})
// 3rd party plugins
.use(emoji)
.use(anchor, {
slugify,
permalink: anchor.permalink.ariaHidden({}),
@ -77,6 +76,7 @@ export const createMarkdownRenderer = (
format: parseHeader,
...options.toc
})
.use(emoji)
// apply user config
if (options.config) {

@ -14,7 +14,7 @@ export const slugify = (str: string): string => {
.replace(rSpecial, '-')
// Remove continuos separators
.replace(/\-{2,}/g, '-')
// Remove prefixing and trailing separtors
// Remove prefixing and trailing separators
.replace(/^\-+|\-+$/g, '')
// ensure it doesn't start with a number (#121)
.replace(/^(\d)/, '_$1')

Loading…
Cancel
Save