From ea6fe90fb6f31e1457b79444511584a872570e51 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Wed, 26 Aug 2020 15:13:30 -0400 Subject: [PATCH] prefer Array#<< to creating a new array and clean up test data part of #191 --- lib/loofah/html5/scrub.rb | 2 +- test/assets/testdata_sanitizer_tests1.dat | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/loofah/html5/scrub.rb b/lib/loofah/html5/scrub.rb index 8a4c806..e2e3d70 100644 --- a/lib/loofah/html5/scrub.rb +++ b/lib/loofah/html5/scrub.rb @@ -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 diff --git a/test/assets/testdata_sanitizer_tests1.dat b/test/assets/testdata_sanitizer_tests1.dat index b564646..a7298ac 100644 --- a/test/assets/testdata_sanitizer_tests1.dat +++ b/test/assets/testdata_sanitizer_tests1.dat @@ -486,10 +486,10 @@ "rexml": "
" }, - { - "name": "style_attr_shorhand_important", + { + "name": "style_attr_shorthand_important", "input": "
", - "output": "
", "xhtml": "
", "rexml": "
" },