Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.13 KB

File metadata and controls

54 lines (36 loc) · 1.13 KB

prettier-plugin-emoji

A Prettier plugin that properly handles emoji shortcodes in markdown files.

Installation

npm install --save-dev prettier-plugin-markdown-preserve-emoji

Usage

After installation, you'll need to add the plugin to your Prettier configuration.

Add it to your .prettierrc (or .prettierrc.json):

{
  "plugins": ["prettier-plugin-markdown-preserve-emoji"]
}

Or specify it via command line:

prettier --plugin=prettier-plugin-markdown-preserve-emoji --write "**/*.md"

This plugin ensures that emoji shortcodes (like :smile:) are properly preserved during formatting, especially when they contain underscores.

Example

Input:

Hello, this is an emoji with underscore :sweat_smile: and _italics words_

Output (preserved incorrectly):

Hello, this is an emoji with underscore :sweat*smile: and \_italics words*

Output (preserved correctly):

Hello, this is an emoji with underscore :sweat_smile: and _italics words_

Configuration

No additional configuration is needed. The plugin works out of the box with Prettier.

License

MIT