Topic: HTML Entities in attribute values
I've been playing around with the various config options for a while but can't figure out a way to tell htmLawed to convert any HTML characters, such as <, >, and " to their HTML entity equivalents (<, >, " etc) before running its other rules.
The problem I have is in a system where some attribute values contain tags for previously used hacky JavaScript stuff. What happens is htmLawed's filters treat these attribute values as actual tags and break everything. For example:
<a href="#" title="<img src='image.gif' />" onclick="function1(); function2();">Do stuff</a>
When that is run through htmLawed it becomes this:
<a href="#">" onclick="function1(); function2();">Do stuff</a>
Obviously this is not good! What I expect it to output (presuming we're allowing onclick attribute in the config) is this:
<a href="#" title="<img src='image.gif' />" onclick="function1(); function2();">Do stuff</a>
Can anyone give me ideas? Is this just a bug? (Or a feature that hasn't yet been implemented!)