Skip to content

Commit 09e48db

Browse files
committed
feat: allow passing options to emoji plugin
close #3174
1 parent 176c400 commit 09e48db

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/node/markdown/markdown.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ export interface MarkdownOptions extends MarkdownIt.Options {
127127
allowedAttributes?: Array<string | RegExp>
128128
disable?: boolean
129129
}
130+
/**
131+
* Options for `markdown-it-emoji`
132+
* @see https://github.com/markdown-it/markdown-it-emoji
133+
*/
134+
emoji?: {
135+
defs?: Record<string, string>
136+
enabled?: string[]
137+
shortcuts?: Record<string, string | string[]>
138+
}
130139
/**
131140
* Options for `@mdit-vue/plugin-frontmatter`
132141
* @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-frontmatter
@@ -211,7 +220,7 @@ export const createMarkdownRenderer = async (
211220
if (!options.attrs?.disable) {
212221
md.use(attrsPlugin, options.attrs)
213222
}
214-
md.use(emojiPlugin)
223+
md.use(emojiPlugin, { ...options.emoji })
215224

216225
// mdit-vue plugins
217226
md.use(anchorPlugin, {

0 commit comments

Comments
 (0)