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
Given this fragment of HTML
<span style="font-size: 36px; font-family: 'AvenirNext-Regular';">This style gets stripped</span> <span style="font-size: 36px; font-family: 'Avenir Next';">This style does not get stripped</span>
When using Loofah to do any kind of stripping:
Loofah.fragment(text).scrub!(:strip) Loofah.fragment(text).scrub!(:prune)
The span with the font-family that has a dash in it gets stripped, but the one without the dash does not:
<span>This style gets stripped</span> <span style="font-size: 36px; font-family: 'Avenir Next';">This style does not get stripped</span>
If I arbitrarily add a dash to the second one:
<span style="font-size: 36px; font-family: 'AvenirNext-Regular';">This style gets stripped</span> <span style="font-size: 36px; font-family: 'Avenir-Next';">This style does not get stripped</span> add dash ^
It also gets scrubbed:
<span>This style gets stripped</span> <span>This style does not get stripped</span>
The text was updated successfully, but these errors were encountered:
Thanks for reporting this! Certainly strange and undesirable behavior. I would certainly call this a bug. Looking into it now.
Sorry, something went wrong.
This appears to have been fixed in v2.1.0 by the introduction of Crass as the underlying CSS parser. Sorry for the delay in replying!
Hey @flavorjones keep up the good work !
I noticed that both text in the examples get stripped in Loofah 2.9.0, I suspect this line: https://github.com/flavorjones/loofah/blob/main/lib/loofah/html5/scrub.rb#L94
Is it intended ?
@aert Let's continue the conversation in #202
No branches or pull requests
Given this fragment of HTML
When using Loofah to do any kind of stripping:
The span with the font-family that has a dash in it gets stripped, but the one without the dash does not:
If I arbitrarily add a dash to the second one:
It also gets scrubbed:
The text was updated successfully, but these errors were encountered: