Skip to content

Commit 75e034a

Browse files
committed
Use Nokogiri::HTML5#fragment for normalising html
This will use the Nokogump and the Gumbo HTML5 parser for HTML normalisation, but as this is already required by Sanitize this should be ok. Changing `parse => fragment` should have no effect and will stip out superfluous elements such as html, head and body.
1 parent 7256fa9 commit 75e034a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/govspeak/html_validator.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def valid?
1818

1919
# Make whitespace in html tags consistent
2020
def normalise_html(html)
21-
Nokogiri::HTML.parse(html).to_s
21+
Nokogiri::HTML5.fragment(html).to_s
2222
end
2323

2424
def govspeak_to_html

0 commit comments

Comments
 (0)