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

Premailer undoes escaping for quotes #355

Open
riffraff opened this issue Nov 27, 2017 · 0 comments
Open

Premailer undoes escaping for quotes #355

riffraff opened this issue Nov 27, 2017 · 0 comments

Comments

@riffraff
Copy link

I have some html that is rendered through the rails rendering pipeline, and ends up with properly escaped special characters. Sadly, when this goes inside premailer, it comes out unescaped.

I.e.

  • given a string with quotes like Rosy O' Donnel

  • which ie escaped through the standard ERB utiles or rails' stuff to become "Rosy O' Donnel"

  • when I pass it through premailer like Premailer.new(escaped, with_html_string: true).to_inline_css

  • I expect: <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n" + "<html><body><p>Rosy O%#39 Donnel</p></body></html>\n

  • but I am getting: "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n" + "<html><body><p>Rosy O' Donnel</p></body></html>\n"

The same happens with ".

Is this expected? Other stuff like & or < is left alone.

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

1 participant