wiki pages: normalize unicode in other names.

This commit is contained in:
evazion
2017-08-12 17:15:19 -05:00
parent 9b031a9c20
commit b215d2112d
2 changed files with 6 additions and 1 deletions

View File

@@ -170,7 +170,7 @@ class WikiPage < ApplicationRecord
end
def normalize_other_names
normalized_other_names = other_names.to_s.gsub(/\u3000/, " ").scan(/\S+/)
normalized_other_names = other_names.to_s.unicode_normalize(:nfkc).scan(/[^[:space:]]+/)
self.other_names = normalized_other_names.uniq.join(" ")
end