1.0.1 • Published 6 months ago
prettier-plugin-markdown-preserve-emoji v1.0.1
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