Skip to content

Commit

Permalink
feat: allow passing options to emoji plugin
Browse files Browse the repository at this point in the history
close #3174
  • Loading branch information
brc-dd committed Dec 31, 2023
1 parent 176c400 commit 09e48db
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/node/markdown/markdown.ts
Expand Up @@ -127,6 +127,15 @@ export interface MarkdownOptions extends MarkdownIt.Options {
allowedAttributes?: Array<string | RegExp>
disable?: boolean
}
/**
* Options for `markdown-it-emoji`
* @see https://github.com/markdown-it/markdown-it-emoji
*/
emoji?: {
defs?: Record<string, string>
enabled?: string[]
shortcuts?: Record<string, string | string[]>
}
/**
* Options for `@mdit-vue/plugin-frontmatter`
* @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-frontmatter
Expand Down Expand Up @@ -211,7 +220,7 @@ export const createMarkdownRenderer = async (
if (!options.attrs?.disable) {
md.use(attrsPlugin, options.attrs)
}
md.use(emojiPlugin)
md.use(emojiPlugin, { ...options.emoji })

// mdit-vue plugins
md.use(anchorPlugin, {
Expand Down

0 comments on commit 09e48db

Please sign in to comment.