markdown-it-emoji is a plugin for the `markdown-it` markdown parser, providing comprehensive support for emoji and emoticon syntax. It parses both standard Unicode emoji shortcodes (e.g., `:smile:`) and common emoticons (e.g., `:)`, `:-(`), converting them into their respective Unicode characters by default. The current stable version is 3.0.0. While no explicit release cadence is stated, it follows the `markdown-it` ecosystem, generally releasing new major versions to align with significant changes or improvements. Key differentiators include its tight integration with `markdown-it`'s plugin architecture, offering configurable emoji sets (full, light, bare), and allowing custom rendering functions for integration with libraries like Twemoji or custom icon fonts. It handles both ESM and CommonJS environments, with specific export changes introduced in v3.
npm install markdown-it-emojiVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing `markdown-it` with the `markdown-it-emoji` plugin, using the `full` emoji set, and rendering a markdown string containing both standard and custom-configured emoticons/emojis.
Update import statements from `import emoji from 'markdown-it-emoji'` or `const emoji = require('markdown-it-emoji')` to `import { full as emoji } from 'markdown-it-emoji'` (or `light`/`bare` as needed).Prefer using a module bundler like Webpack or Rollup for browser environments to manage dependencies and avoid global pollution, or ensure unique naming if manual script loading is unavoidable.
Add `.emoji { height: 1.2em; }` CSS to ensure vertical alignment. Consult Twemoji documentation for `twemoji.parse` options (e.g., `size`, `ext`) to control image attributes.Review the `defs` and `shortcuts` options to customize or extend the emoji and emoticon mapping to meet specific project requirements or to update to newer emoji sets if desired.
Ensure you are using `import { full as emoji } from 'markdown-it-emoji'` in an ESM context, or that your build tools correctly transpile and handle ESM imports for Node.js.If using a module bundler, import it as `import { full as emoji } from 'markdown-it-emoji'`. If loading directly in HTML, ensure the script tag is present and correct, and you're accessing `markdownitEmoji` only after the script has fully loaded.