You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plugin for markdown-it markdown parser, adding emoji & emoticon syntax support. Also supports emoticons shortcuts like :), :-(, and others.
NOTE. v3 changed exports, see below.
Install
npm install markdown-it-emoji
Use
init
//// { full, light, bare } configs available.//// full: includes all available emojis support// light: includes small subset of most useable emojis// bare: no defaults//// Also CJS & UMD builds available in `dist/` folder of published package,// if your env not supports ESM modules use.//import{fullasemoji}from'markdown-it-emoji'importmarkdownitfrom'markdown-it'constmd=markdownit().use(emoji/* , options */);
Options are not mandatory:
defs (Object) - rewrite available emoji definitions
example: { name1: char1, name2: char2, ... }
enabled (Array) - disable all emojis except whitelisted
Differences in browser. If you load the script directly into the page without
using a package system, the module will add itself globally with the name markdownitEmoji.
change output
By default, emojis are rendered as appropriate unicode chars. But you can change
the renderer function as you wish.
Render as span blocks (for example, to use a custom iconic font):