fix: include emoji text in nav link to match toc

Fix a comment typo
pull/284/head
Sam Pullman 5 years ago
parent 77f144a0c7
commit 9d06f1c212

@ -67,7 +67,6 @@ export const createMarkdownRenderer = (
}) })
// 3rd party plugins // 3rd party plugins
.use(emoji)
.use(anchor, { .use(anchor, {
slugify, slugify,
permalink: true, permalink: true,
@ -82,6 +81,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