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

Undesired interpretation of HTML-encoded characters #192

Closed
Xavier-Mobius opened this issue Feb 6, 2024 · 3 comments
Closed

Undesired interpretation of HTML-encoded characters #192

Xavier-Mobius opened this issue Feb 6, 2024 · 3 comments

Comments

@Xavier-Mobius
Copy link

Xavier-Mobius commented Feb 6, 2024

Hello, and thank you for this very useful library! :)

Mjml.Net does not produce the same result as mjml.io.
Mjml.Net interprets HTML-encoded characters (it "de-encodes" such characters) even if they are "HTML Character Entity Number" instead of "Character Entity Names"..

A very simple example:

using Mjml.Net;

var mjmlRenderer = new MjmlRenderer();
(var result, var errors) = mjmlRenderer.Render(@"<mj-text>Hello &gt;&#62; World</mj-text>");

Console.WriteLine(result);

Output:

<div style="[...]">
Hello >> World
</div>

The output of the same MJML in https://mjml.io/try-it-live/eiXRjriBbY :

<div style="[...]">Hello &gt;&#62; World</div>

How can I fix this, or get around this problem?

@SebastianStehle
Copy link
Owner

I had a look to it and is not resolved properly at the moment. I created a PR for the html library: osjoberg/HtmlPerformanceKit#8

I hope this gets merged (soon). Then I can provide a fix for you.

@SebastianStehle
Copy link
Owner

Sorry, I have forgotten to notify. This was actually merged in a week ago or so.

@Xavier-Mobius
Copy link
Author

Yes, I saw that yesterday, you fixed it in the version 3.9. Thanks a lot :)

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