-
Notifications
You must be signed in to change notification settings - Fork 200
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
Sanitizer process attributes with no values #93
Comments
I think that's actually due to AngleSharp (see AngleSharp #434), and it's likely because the latter is correct XML. From reading that issue, it seems like this is intentional, at least for now. It's a kludge, but you can probably post-process the sanitized markup to remove the empty attribute value:
Not pretty, but I don't see why it wouldn't work. |
Browsers seem to behave the same way: var d = document.createElement("div");
d.innerHTML = '<span title>Test</span>';
d.innerHTML ⇒ <span title="">Test</span> The sanitizer used on GitHub does the opposite: Besides what @tiesont suggested, you can also provide your own instance of if (string.IsNullOrEmpty(value)) return temp.ToString(); |
I use special ExtJS HTML templates that need to have attributes without value. E.g.
When I run Sanitizer, it converts it to
Which is not valid for ExtJS. Is there a way to leave attributes as is?
Thank you!
The text was updated successfully, but these errors were encountered: