Aggressive emoji support with twemoji #19
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR will add an aggressive emoji support with twemoji.
@marp-team/marpit has removed unicode emoji support on v0.0.12 because of issues in stable Chrome (Refer to marp-team/marpit#53).
However, marp-core should not mutate an exported result by environment's emoji fonts because of supporting on multi-platform including Web. (e.g. Server-side PDF rendering)
So we implement the aggressive Emoji conversion by using twemoji. It can convert emoji shortcodes and any Unicode emoji to twemoji. Especially Unicode will convert even if it was included in
<code>
elements. (Ported from previous Marpit implementation)Unlike Marpit's previous printable emoji support, the rendered emoji by twemoji is always colored and would never vanish.
Aggressive conversion of unicode emoji
Options
Some people might disappoint not to be able to use Unicode emoji. Thus we add
emoji
option in Marp constructor. You can customize option if you are using marp-core directly.We might stop the conversion of Unicode emoji when the stable colored emoji rendering was supported on Chrome in future.