feat: allow passing options to emoji plugin

close #3174
pull/3398/head
Divyansh Singh 11 months ago
parent 176c4008c5
commit 09e48db355

@ -127,6 +127,15 @@ export interface MarkdownOptions extends MarkdownIt.Options {
allowedAttributes?: Array<string | RegExp> allowedAttributes?: Array<string | RegExp>
disable?: boolean 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` * Options for `@mdit-vue/plugin-frontmatter`
* @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-frontmatter * @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-frontmatter
@ -211,7 +220,7 @@ export const createMarkdownRenderer = async (
if (!options.attrs?.disable) { if (!options.attrs?.disable) {
md.use(attrsPlugin, options.attrs) md.use(attrsPlugin, options.attrs)
} }
md.use(emojiPlugin) md.use(emojiPlugin, { ...options.emoji })
// mdit-vue plugins // mdit-vue plugins
md.use(anchorPlugin, { md.use(anchorPlugin, {

Loading…
Cancel
Save