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

pull/374/head
Sam Pullman 4 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 // 3rd party plugins
.use(emoji)
.use(anchor, { .use(anchor, {
slugify, slugify,
permalink: anchor.permalink.ariaHidden({}), permalink: anchor.permalink.ariaHidden({}),
@ -77,6 +76,7 @@ export const createMarkdownRenderer = (
format: parseHeader, format: parseHeader,
...options.toc ...options.toc
}) })
.use(emoji)
// apply user config // apply user config
if (options.config) { if (options.config) {

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

Loading…
Cancel
Save