Open guoyunhe opened 8 months ago
I reopened this issue ticket since #31 was reverted.
Since remark is essentially a transformation from Markdown AST to HTML AST, it is difficult to provide APIs which allow to specify raw Markdown or HTML sources (if we do, we need to parse the sources into AST nodes in advance).
Configuration like below would be easier, but I'm not sure it is useful (since I don't have use case to provide custom emoijs).
remark().use(emoji, {
customEmojis: {
parrot: {
src: 'https://cultofthepartyparrot.com/parrots/parrot.gif', // "src" of <img> (requried)
aria: 'rainbow parrot', // aria label for accessibility (optional)
}
}
});
I created a new PR #32 that has custom emoji support. I plan to use this in my web game.
In many forum and chat apps, you are able to create your own emojis, like
And you can have your own short code:
Configuration will be like: