Skip to content
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

border-collapse other than "collapse" is stripped, even when safelisted #201

Closed
bbugh opened this issue Feb 24, 2021 · 3 comments · Fixed by #214
Closed

border-collapse other than "collapse" is stripped, even when safelisted #201

bbugh opened this issue Feb 24, 2021 · 3 comments · Fixed by #214

Comments

@bbugh
Copy link

bbugh commented Feb 24, 2021

Any valid properties for border-collapse except collapse is being stripped out; initial, unset, inherit, etc. This makes it impossible to do border-radius on tables that have a stylesheet default of collapse.

This happens with all of the scrubbers (that I know of) that would affect this: prune, strip, whitewash.

Example:

>> Loofah.fragment(%Q(<table style="border-collapse: separate;"><tr><td></td></tr></table)).scrub!(:prune).to_s
=> "<table><tr><td></td></tr></table>"

But:

>> Loofah::HTML5::SafeList::ALLOWED_CSS_PROPERTIES.include?('border-collapse')
=> true
@flavorjones
Copy link
Owner

@bbugh Thanks for opening this issue, and sorry for my slow reply. I've reproduced this and it's because collapse is a member of Loofah::HTML5::SafeList::ACCEPTABLE_CSS_KEYWORDS.

See #214 for the fix.

@bbugh
Copy link
Author

bbugh commented Jul 31, 2021

Thank you! No problem, you're a champion for all the work you do to keep this running.

@flavorjones
Copy link
Owner

Fixed in v2.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants