Installations
npm install @gerhobbelt/markdown-it-emoji
Developer Guide
Typescript
No
Module System
ESM
Min. Node Version
>=12.20.0
Node Version
16.4.1
NPM Version
7.19.1
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (86.1%)
Makefile (13.9%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
4,713
Last Day
1
Last Week
6
Last Month
63
Last Year
522
GitHub Statistics
MIT License
3 Stars
96 Commits
1 Forks
2 Watchers
1 Branches
1 Contributors
Updated on Feb 07, 2022
Package Meta Information
Latest Version
2.0.0-12
Package Id
@gerhobbelt/markdown-it-emoji@2.0.0-12
Unpacked Size
104.85 kB
Size
29.67 kB
File Count
26
NPM Version
7.19.1
Node Version
16.4.1
Total Downloads
Cumulative downloads
Total Downloads
4,713
Last Day
-50%
1
Compared to previous day
Last Week
-60%
6
Compared to previous week
Last Month
320%
63
Compared to previous month
Last Year
-36.3%
522
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.
v1.+ requires markdown-it
v4.+, see changelog.
Three versions:
- Full (default), with all github supported emojis.
- Light, with only well-supported unicode emojis and reduced size.
- Bare, without included emojis or shortcuts. This requires defining your own definitions and shortcuts.
Also supports emoticons shortcuts like :)
, :-(
, and others. See the full list in the link above.
Install
node.js, browser:
1npm install @gerhobbelt/markdown-it-emoji --save
Use
init
1var md = require('@gerhobbelt/markdown-it')(); 2var emoji = require('@gerhobbelt/markdown-it-emoji'); 3// Or for light version 4// var emoji = require('@gerhobbelt/markdown-it-emoji/light'); 5 6md.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
.
Init code will look a bit different in this case:
1var md = window.markdownit().use(window.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 4var twemoji = require('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}
License

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
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
23 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp
- Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Score
1.7
/10
Last Scanned on 2025-02-10
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 More