hypermd-twemoji
Use twemoji to display emojis
⚠️ License
Please follow https://github.com/twitter/twemoji#license if you use this powerpack. 使用前请注意阅读 twemoji 使用许可
How to use
- install
twemoji
andhypermd-twemoji
import
before creating HyperMD editor- create HyperMD editor
For webpack / parcel
First of all, install the packages: npm install --save hypermd-twemoji twemoji
const your_textarea = documentconst editor = HyperMD
For requirejs (example)
In your HTML:
I'm using twemoji to render emojis! :tada: <!-- 👈 RequireJS --> <!-- 👈 IMPORTANT -->
In your main.js
// before defining your main entry, don't forget :requirejs // then, add "hypermd-twemoji" to your main-entry's dependency list.
Finally, here is an example of main.js
and a live demo.
For Plain Browser Env
Why hurting yourself? The bundlers and module loaders are the future!
Add these HTML after loading HyperMD, before creating a editor.
See the source of example file
APIs
This module exports following symbols.
(In plain browser env, they are stored in global variable HyperMD_PowerPack.twemoji
)
setOptions(options?)
-- set the optional option parameter fortwemoji.parse
twemojiChecker
-- a EmojiChecker for HyperMD.FoldEmojitwemojiRenderer
-- a EmojiRenderer for HyperMD.FoldEmoji