Skip to content

Commit

Permalink
prefer Array#<< to creating a new array
Browse files Browse the repository at this point in the history
and clean up test data

part of flavorjones#191
  • Loading branch information
flavorjones committed Aug 26, 2020
1 parent 50931f4 commit ea6fe90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/loofah/html5/scrub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def scrub_css(style)
end
end.compact
unless value.empty?
value += [CSS_IMPORTANT] if node[:important]
value << CSS_IMPORTANT if node[:important]
propstring = sprintf "%s:%s", name, value.join(" ")
sanitized_node = Crass.parse_properties(propstring).first
sanitized_tree << sanitized_node << CRASS_SEMICOLON
Expand Down
6 changes: 3 additions & 3 deletions test/assets/testdata_sanitizer_tests1.dat
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,10 @@
"rexml": "<div style='color: blue;'></div>"
},

{
"name": "style_attr_shorhand_important",
{
"name": "style_attr_shorthand_important",
"input": "<div style=\"border: 2px dashed gray !important;\" />",
"output": "<div style='border:2px dashed gray !important;/>",
"output": "<div style='border:2px dashed gray !important;'/>",
"xhtml": "<div style='border:2px dashed gray !important;'></div>",
"rexml": "<div style='border:2px dashed gray !important;'></div>"
},
Expand Down

0 comments on commit ea6fe90

Please sign in to comment.