nomoji
v16.1.1
Published
Replace emojis in text with SVG images ([https://github.com/googlefonts/noto-emoji](https://github.com/googlefonts/noto-emoji))
Readme
nomoji
Replace emojis in text with SVG images (https://github.com/googlefonts/noto-emoji)
installation
npm i nomojiusage
nomoji(text, [prefix], [disableSanitation])
nomoji("Hello from 🇫🇮");Hello from <img draggable="false" class="emoji" src="svg/1f1eb_1f1ee.svg" />The optional prefix parameter defines where to find image files
nomoji("Hello from 🇫🇮", "nomoji/");Hello from
<img draggable="false" class="emoji" src="nomoji/svg/1f1eb_1f1ee.svg" />The optional disableSanitation parameter disables HTML sanitation
nomoji("Hello <b>HTML</b> 🤩!");Hello <b>HTML</b>
<img draggable="false" class="emoji" src="svg/1f929.svg" />!nomoji("Hello <b>HTML</b> 🤩!", null, true);Hello <b>HTML</b>
<img draggable="false" class="emoji" src="dist/svg/1f929.svg" />!You can customize the style in CSS with .emoji selector:
.emoji {
width: 1em;
height: 1em;
}