FIX: Use correct Regexp flag to ignore case (#19184)

Ruby 3.2 started enforcing valid string flags in Regexp constructor.
This commit is contained in:
Rafael dos Santos Silva 2022-11-25 10:56:59 -03:00 committed by GitHub
parent 84c1cc70d6
commit 90411540c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ class TextCleaner
text
end
@@whitespaces_regexp = Regexp.new("(\u00A0|\u1680|\u180E|[\u2000-\u200A]|\u2028|\u2029|\u202F|\u205F|\u3000)", "u").freeze
@@whitespaces_regexp = Regexp.new("(\u00A0|\u1680|\u180E|[\u2000-\u200A]|\u2028|\u2029|\u202F|\u205F|\u3000)", Regexp::IGNORECASE).freeze
def self.normalize_whitespaces(text)
text&.gsub(@@whitespaces_regexp, ' ')