Closed
Description
Raising this issue as I feel like it's a bug, or maybe a lack of documentation.
I ran a script to remove all the inline styles from the database. And it turned out that it removed all the iframes as well. Here's a summary of it
scrubber = Rails::Html::TargetScrubber.new
scrubber.attributes = ['style']
html_with_iframe = '<iframe style="display: none" width="1231" height="699" src="https://www.youtube.com/embed/abcd"></iframe>'
html_fragment = Loofah.fragment(html_with_iframe)
html_fragment.scrub!(scrubber) # scrubbed the iframe
new_html = html_fragment.to_s # empty string
To make this work, I actually have to tell the scrubber to not scrub any tags with scrubber.tags = []
even if scrubber.tags
returns nil
after the initialization.
Metadata
Metadata
Assignees
Labels
No labels