Fix regression in HtmlSanitizer::cleanup_target (whitespace deletion)

This commit is contained in:
Ryan Lue 2018-06-12 15:39:17 +08:00
parent 5583369d8b
commit 23f30921dc

View file

@ -375,7 +375,7 @@ cleanup html string:
def self.cleanup_target(string, **options)
cleaned_string = CGI.unescape(string).utf8_encode(fallback: :read_as_sanitized_binary)
cleaned_string = cleaned_string.delete(' ') unless options[:keep_spaces]
cleaned_string = cleaned_string.gsub(/[[:space:]]/, '') if !options[:keep_spaces]
cleaned_string = cleaned_string.strip
.delete("\t\n\r\u0000")
.gsub(%r{/\*.*?\*/}, '')