We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I want to serialize an element, the underlying HtmlMarkupFormatter transforms any "&" characters contained in attributes into "&"
Example:
var btn = document.CreateElement("a"); btn.InnerHtml = "Test"; btn.SetAttribute("href", "http://google.com?param=param&q=test"); var html = btn.OuterHtml; // <-- http://google.com?param=param&q=test
Digging into the code, I've found this in HtmlMarkupFormatter.cs, line 118
String IMarkupFormatter.Attribute(IAttr attribute) ... for (var i = 0; i < value.Length; i++) { switch (value[i]) { case Symbols.Ampersand: temp.Append("&"); break; case Symbols.NoBreakSpace: temp.Append(" "); break; case Symbols.DoubleQuote: temp.Append("""); break; default: temp.Append(value[i]); break; } }
I think that, apart from the double quote, the rest of symbols are all valid into an attribute value.
The text was updated successfully, but these errors were encountered:
This is by specification, see the string escaping that needs to be applied on attribute values..
Sorry, something went wrong.
You are right. I haven't noticed that any browser behaves this way.
Thank you for your response!
No branches or pull requests
When I want to serialize an element, the underlying HtmlMarkupFormatter transforms any "&" characters contained in attributes into "&"
Example:
Digging into the code, I've found this in HtmlMarkupFormatter.cs, line 118
I think that, apart from the double quote, the rest of symbols are all valid into an attribute value.
The text was updated successfully, but these errors were encountered: