Fix #2894: Use [[:space:]] instead of \s in regexes.

This commit is contained in:
evazion
2018-09-20 19:13:31 -05:00
parent 29cdaddd86
commit 03abbd0683
24 changed files with 56 additions and 44 deletions

View File

@@ -24,11 +24,9 @@ class AliasAndImplicationImporter
end
def self.tokenize(text)
text = text.dup
text.gsub!(/^\s+/, "")
text.gsub!(/\s+$/, "")
text.gsub!(/ {2,}/, " ")
text.split(/\r\n|\r|\n/).map do |line|
line = line.gsub(/[[:space:]]+/, " ").strip
if line =~ /^(?:create alias|aliasing|alias) (\S+) -> (\S+)$/i
[:create_alias, $1, $2]