mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Skip gsub for normalizing whitespaces when text is nil (#6631)
This commit is contained in:
@@ -57,7 +57,7 @@ class TextCleaner
|
||||
@@whitespaces_regexp = Regexp.new("(\u00A0|\u1680|\u180E|[\u2000-\u200A]|\u2028|\u2029|\u202F|\u205F|\u3000)", "u").freeze
|
||||
|
||||
def self.normalize_whitespaces(text)
|
||||
text.gsub(@@whitespaces_regexp, ' ')
|
||||
text&.gsub(@@whitespaces_regexp, ' ')
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user