-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emoji Rendering Discrepancy Between Inline and Block Elements #309
Comments
markdown-it AST of the provided example will become as below: [
{
"type": "paragraph_open",
"tag": "p",
"attrs": null,
"map": [
0,
1
],
"nesting": 1,
"level": 0,
"children": null,
"content": "",
"markup": "",
"info": "",
"meta": null,
"block": true,
"hidden": false
},
{
"type": "inline",
"tag": "",
"attrs": null,
"map": [
0,
1
],
"nesting": 0,
"level": 1,
"children": [
{
"type": "html_inline",
"tag": "",
"attrs": null,
"map": null,
"nesting": 0,
"level": 0,
"children": null,
"content": "<span>",
"markup": "",
"info": "",
"meta": null,
"block": false,
"hidden": false
},
{
"type": "text",
"tag": "",
"attrs": null,
"map": null,
"nesting": 0,
"level": 0,
"children": null,
"content": "Inline: 🙂",
"markup": "🙂",
"info": "entity",
"meta": null,
"block": false,
"hidden": false
},
{
"type": "html_inline",
"tag": "",
"attrs": null,
"map": null,
"nesting": 0,
"level": 0,
"children": null,
"content": "</span>",
"markup": "",
"info": "",
"meta": null,
"block": false,
"hidden": false
}
],
"content": "<span>Inline: 🙂</span>",
"markup": "",
"info": "",
"meta": null,
"block": true,
"hidden": false
},
{
"type": "paragraph_close",
"tag": "p",
"attrs": null,
"map": null,
"nesting": -1,
"level": 0,
"children": null,
"content": "",
"markup": "",
"info": "",
"meta": null,
"block": true,
"hidden": false
},
{
"type": "html_block",
"tag": "",
"attrs": null,
"map": [
2,
3
],
"nesting": 0,
"level": 0,
"children": null,
"content": "<div>Block: 🙂</div>",
"markup": "",
"info": "",
"meta": null,
"block": true,
"hidden": false
}
] Marp Core will transform an emoji within the content of Lines 76 to 109 in 5c5eda0
On the other hand, the block element and its children are parsed as a single For emoji transformation in
|
Version of Marp Tool
v1.0.0
Operating System
Linux
Environment
Running in a Docker container. (The latest version 2.0.4 seems to suffer from the same issue.)
How to reproduce
Create the following Markdown file named slide-deck.md:
Run the following CLI command with Docker to generate HTML:
$ docker run --rm -v $PWD:/home/marp/app/ -e LANG=$LANG -e MARP_USER="$(id -u):$(id -g)" marpteam/marp-cli:v1.0.0 slide-deck.md
Run the following CLI command with Docker to generate PDF:
$ docker run --rm -v $PWD:/home/marp/app/ -e LANG=$LANG -e MARP_USER="$(id -u):$(id -g)" marpteam/marp-cli:v1.0.0 slide-deck.md --pdf
Expected behavior
Both emojis rendered the same way and visible in the resulting PDF document.
Actual behavior
The inline emoji is rendered as an image element:
<img class="emoji" draggable="false" alt="🙂" src="https://twemoji.maxcdn.com/2/svg/1f642.svg" data-marp-twemoji="">
, while the block element emoji is rendered literally: 🙂This is a problem when targeting PDF as the output format:
Additional information
No response
The text was updated successfully, but these errors were encountered: