diff --git a/lib/loofah/html5/scrub.rb b/lib/loofah/html5/scrub.rb index d9f55707..5dbfb87e 100644 --- a/lib/loofah/html5/scrub.rb +++ b/lib/loofah/html5/scrub.rb @@ -6,7 +6,7 @@ module Loofah module HTML5 # :nodoc: module Scrub CONTROL_CHARACTERS = /[`\u0000-\u0020\u007f\u0080-\u0101]/ - CSS_KEYWORDISH = /\A(#[0-9a-fA-F]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|-?\d{0,3}\.?\d{0,10}(ch|cm|r?em|ex|in|mm|pc|pt|px|Q|vw|vh|%|,|\))?)\z/ + CSS_KEYWORDISH = /\A(#[0-9a-fA-F]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|-?\d{0,3}\.?\d{0,10}(ch|cm|r?em|ex|in|lh|mm|pc|pt|px|Q|vw|vh|%|,|\))?)\z/ CRASS_SEMICOLON = { :node => :semicolon, :raw => ";" } class << self diff --git a/test/html5/test_sanitizer.rb b/test/html5/test_sanitizer.rb index 60f04a4f..8d6f97d6 100755 --- a/test/html5/test_sanitizer.rb +++ b/test/html5/test_sanitizer.rb @@ -323,6 +323,12 @@ def test_css_Q_value assert_match %r/10Q/, sane.inner_html end + def test_css_lh_value + html = "