Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/node/markdown/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export const createMarkdownRenderer = (
})

// 3rd party plugins
.use(emoji)
.use(anchor, {
slugify,
permalink: true,
Expand All @@ -82,6 +81,7 @@ export const createMarkdownRenderer = (
format: parseHeader,
...options.toc
})
.use(emoji)

// apply user config
if (options.config) {
Expand Down
2 changes: 1 addition & 1 deletion src/node/markdown/plugins/slugify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down