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

Named entities in attribute values breaks IE syntax #418

Closed
doxavore opened this issue Jul 22, 2011 · 1 comment
Closed

Named entities in attribute values breaks IE syntax #418

doxavore opened this issue Jul 22, 2011 · 1 comment

Comments

@doxavore
Copy link

An attribute value is currently replaced with named HTML entities if it has both an apostrophe and a double quote:

%div{"data-props" => "someJsValue: 'has a \"something quoted\" in it'"}
becomes:
<div data-props="someJsValue: 'has a &quot;something quoted&quot; in it'"></div>

This is fine for sane browsers, but IE deems it is a syntax error. All browsers, however, can handle using key character codes:
<div data-props="someJsValue: 'has a &#34;something quoted&#34; in it'"></div>

Other than punishing those who must support IE, is there any reason for not changing this?

@doxavore
Copy link
Author

Moved detail to ticket created from pull request... sorry for the confusion.

stepheneb pushed a commit to stepheneb/haml that referenced this issue Sep 18, 2011
When attribute values contain both an apostrophe and a double quote,
we should substitute the character being used to wrap the value with
its key code instead of named/keyword entities (for IE support).

Fixes haml#418.
snatchev pushed a commit to snatchev/haml that referenced this issue Apr 30, 2012
When attribute values contain both an apostrophe and a double quote,
we should substitute the character being used to wrap the value with
its key code instead of named/keyword entities (for IE support).

Fixes haml#418.

Signed-off-by: Norman Clarke <norman@njclarke.com>
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

Successfully merging a pull request may close this issue.

1 participant