Skip to content
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

HTML Comments rendered with additional white space #2882

Open
gglnx opened this issue Jul 9, 2024 · 3 comments
Open

HTML Comments rendered with additional white space #2882

gglnx opened this issue Jul 9, 2024 · 3 comments

Comments

@gglnx
Copy link

gglnx commented Jul 9, 2024

Describe the bug
Currently, HTML comments get additional whitespace inside in the beginning and the end: <!--#TEST--> will be transformed to <!-- #TEST -->. CleverReach uses HTML comments as a programming language and doesn't support a space or any other whitespace character between the start of the comment and the command (<!--#loop #--> works, <!-- #loop # --> not).

To Reproduce
Steps to reproduce the behavior:

  1. Create a file with this MJML code: <mjml><!--#COMMAND#--></mjml>
  2. Render it to HTML and compare it

Expected behavior
Preserving of no or all whitespaces in HTML comments.

MJML environment (please complete the following information):

  • OS: MacOS
  • MJML Version: 4.15.3
  • MJML tool used: mjml-cli
@iRyusa
Copy link
Member

iRyusa commented Jul 30, 2024

Did you tried to wrap in mj-raw those comment ?

@gglnx
Copy link
Author

gglnx commented Jul 30, 2024

Yes, to temporarily fix it. But I would like to prefer it, that MJML doesn't modify the whitespace inside an HTML comment.

@iRyusa
Copy link
Member

iRyusa commented Jul 30, 2024

Might be fixable as the space might be introduced by this https:/mjmlio/mjml/blob/master/packages/mjml-parser-xml/src/index.js#L315-L326

I'll check later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants