-
Notifications
You must be signed in to change notification settings - Fork 118
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
PreMailer is encoding URLs with base64-encoded querystrings, which is breaking links #172
Comments
This is the correct output. Per user @FlorianRappl on the relevant AngleSharp issue AngleSharp/AngleSharp#348:
|
@jordanwallwork - this is not the correct output even if the HTML standard says attribute values need to be string escaped. PreMailer.Net is a CSS inliner, it is not an HTML validator or sanitizer. This side effect is completely blocking some of my work and I need a workaround. I don't have any control over the URLs in the HTML, but I am not allowed to change them. I need to inline the CSS without changing the URLs. Additionally, it encodes these values even when they are not an HTML attribute value, which is definitely wrong.
This is not required to be encoded by the HTML specification but PreMailer.Net encodes it anyway. Result:
|
EDIT: Sorry, I haven't seen this solution: So, I'm going to try to write a formatter. |
I am currently using PreMailer.NET 2.0.1 with AngleSharp 0.9.11. If I start from a source HTML document like this:
<img src="https://mysite.com/images/render.aspx?width=230&height=100&path=c%2BMSWoLAkkaX9MuWPh3OJYPQ8yJdCI6GoS80sywIaDgWYBpoq4FU6pmpOL5Ve1keh7yYqHAF9mBMrMrLYtx4xQ%3D%3D" />
That gets rendered by PreMailer as:
<img src="https://mysite.com/images/render.aspx?width=230&height=100&path=c%2BMSWoLAkkaX9MuWPh3OJYPQ8yJdCI6GoS80sywIaDgWYBpoq4FU6pmpOL5Ve1keh7yYqHAF9mBMrMrLYtx4xQ%3D%3D" />
which when clicked on from the mail client, causes the web server to not correctly display the image, as it cannot parse the
path
parameter correctly.How can I stop PreMailer from encoding the
&
in the URL? From what I've seen of other encoding issues, it may actually be a problem with AngleSharp, but I've a) yet to see any documentation on how to stop that behaviour in AngleSharp, and b) no idea how that would be controlled from PreMailer anyway.The text was updated successfully, but these errors were encountered: