Skip to content

boncz92/prettier-markdown-preserve-emoji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published