Emoji syntax plugin for markdown-it markdown parser
Installations
npm install markdown-it-emoji
Developer Guide
Typescript
No
Module System
CommonJS, ESM
Node Version
18.14.1
NPM Version
9.3.1
Score
99.6
Supply Chain
99.6
Quality
75.6
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
73,662,550
Last Day
70,745
Last Week
402,767
Last Month
1,631,157
Last Year
17,247,362
GitHub Statistics
MIT License
734 Stars
79 Commits
168 Forks
9 Watchers
2 Branches
7 Contributors
Updated on Jan 18, 2025
Bundle Size
42.99 kB
Minified
16.50 kB
Minified + Gzipped
Package Meta Information
Latest Version
3.0.0
Package Id
markdown-it-emoji@3.0.0
Unpacked Size
336.34 kB
Size
98.03 kB
File Count
23
NPM Version
9.3.1
Node Version
18.14.1
Published on
Dec 07, 2023
Total Downloads
Cumulative downloads
Total Downloads
73,662,550
Last Day
3.6%
70,745
Compared to previous day
Last Week
9.4%
402,767
Compared to previous week
Last Month
30.6%
1,631,157
Compared to previous month
Last Year
-5.7%
17,247,362
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
markdown-it-emoji
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
1npm install i markdown-it-emoji
Use
init
1// 2// { full, light, bare } configs available. 3// 4// full: includes all available emojis support 5// light: includes small subset of most useable emojis 6// bare: no defaults 7// 8// Also CJS & UMD builds available in `dist/` folder of published package, 9// if your env not supports ESM modules use. 10// 11import { full as emoji } from 'markdown-it-emoji' 12import markdownit from 'markdown-it' 13 14const md = markdownit().use(emoji/* , options */);
Options are not mandatory:
- defs (Object) - rewrite available emoji definitions
- example:
{ name1: char1, name2: char2, ... }
- example:
- enabled (Array) - disable all emojis except whitelisted
- shortcuts (Object) - rewrite default shortcuts
- example:
{ "smile": [ ":)", ":-)" ], "laughing": ":D" }
- example:
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):
1// ... 2// initialize 3 4md.renderer.rules.emoji = function(token, idx) { 5 return '<span class="emoji emoji_' + token[idx].markup + '"></span>'; 6};
Or use twemoji:
1// ... 2// initialize 3 4import twemoji from 'twemoji' 5 6md.renderer.rules.emoji = function(token, idx) { 7 return twemoji.parse(token[idx].content); 8};
NB 1. Read twemoji docs! In case you need more options to change image size & type.
NB 2. When using twemoji you can make image height match the line height with this style:
1.emoji { 2 height: 1.2em; 3}
In your markdown file
1Hello from mars :satellite:
becomes
Hello from mars 📡

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/markdown-it/.github/SECURITY.md:1
- Info: Found linked content: github.com/markdown-it/.github/SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/markdown-it/.github/SECURITY.md:1
- Info: Found text in security policy: github.com/markdown-it/.github/SECURITY.md:1
Reason
Found 3/28 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/markdown-it/markdown-it-emoji/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/markdown-it/markdown-it-emoji/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/markdown-it/markdown-it-emoji/ci.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:27
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 5 are checked with a SAST tool
Score
4.2
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to markdown-it-emoji
@types/markdown-it-emoji
TypeScript definitions for markdown-it-emoji
markdown-it-icons
Plugin for markdown-it, supports emoji icons and font-awesome icons.
markdown-it-emoji-mart
Emoji-mart supported emojis plugin for markdown-it markdown parser.
@gerhobbelt/markdown-it-emoji
Emoji plugin for markdown-it markdown parser.