You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
First of all I would like to thank you for this awesome gem. But I found a bug while trying to sanitize a string that has both valid and invalid chars. below i explain this problem better:
coder=HTMLEntities.newstring="> Car & Bike <"new=coder.encode(string)# BUG => "> Car &amp; Bike <" worst_then_new=coder.encode(new)# BUG => "&gt; Car &amp;amp; Bike &lt;"
A workaround this problem would be to "decode" before "encode" but this hack is to slow...
The text was updated successfully, but these errors were encountered:
This is the intended behaviour: the goal of HTMLEntities is to encode and decode in a predictable manner. It's not supposed to fix invalid or incoherent sources, and it doesn't make any attempt to try to understand the intent of inconsistencies in the source, as this depends on the application.
Indeed HTMLEntities is pretty good to encode and decode, but in my case I needed a simple and fast sanitizer to clean inconsistent sources, so i used HTMLEntities to created the https://github.com/3den/ruby-sanitizer
Hi,
First of all I would like to thank you for this awesome gem. But I found a bug while trying to sanitize a string that has both valid and invalid chars. below i explain this problem better:
A workaround this problem would be to "decode" before "encode" but this hack is to slow...
The text was updated successfully, but these errors were encountered: