-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Loofah to scrub HTML attachments
`:prune` removes unknown/unsafe tags and their contents (including their subtrees): unsafe_html = "ohai! <div>div is safe</div> <foo>but foo is <b>not</b></foo>" Loofah.fragment(unsafe_html).scrub!(:prune) # => "ohai! <div>div is safe</div> " * Adds a `DOCTYPE` to the fixture file so that Nokogiri doesn't insert a HTML 4 `DOCTYPE` automatically, making comparison in the spec uglier * Nokogiri also adds a `meta` tag to the output. Not much we can do about this: sparklemotion/nokogiri#1008
- Loading branch information
1 parent
f0665ba
commit d20a309
Showing
3 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
|