Closed mrcoles closed 1 year ago
This appears to be a bug inside mj-text rendering. If I run this code:
mj-text
from mjml import mjml_to_html print(mjml_to_html('<mjml><mj-body><mj-text>Hello <a href="#">world</a></mj-text></mj-body></mjml>')['html'].split('\n')[-3])
I get this output:
<div style=""><div style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:1;text-align:left;color:#000000">Hello<a href="#">world</a></div></div>
The space between "Hello" and "<a" gets stripped during the parsing.
I haven’t been able to dive through the code enough, yet, but seems like the first children element inside this mj-text should have elem["tail"] == " " https://github.com/FelixSchwarz/mjml-stub/blob/main/mjml/elements/mj_text.py#L104
elem["tail"] == " "
This appears to be a bug inside
mj-text
rendering. If I run this code:I get this output:
The space between "Hello" and "<a" gets stripped during the parsing.
I haven’t been able to dive through the code enough, yet, but seems like the first children element inside this
mj-text
should haveelem["tail"] == " "
https://github.com/FelixSchwarz/mjml-stub/blob/main/mjml/elements/mj_text.py#L104