artists: fix misnormalization of emoji in other names.

Fix `normalize_whitespace` to not strip zero-width joiner characters
(U+200D). These characters are used in emoji and stripping them breaks
some artist other names that use emoji.
This commit is contained in:
evazion
2021-01-10 02:46:20 -06:00
parent 0899194f6b
commit d18dc573fb
2 changed files with 4 additions and 2 deletions

View File

@@ -401,6 +401,7 @@ class ArtistTest < ActiveSupport::TestCase
should normalize_attribute(:other_names).from([nil, "", " "]).to([])
should normalize_attribute(:other_names).from(["pokémon".unicode_normalize(:nfd)]).to(["pokémon".unicode_normalize(:nfkc)])
should normalize_attribute(:other_names).from(["foo", "foo"]).to(["foo"])
should normalize_attribute(:other_names).from(["🏳️‍🌈"]).to(["🏳️‍🌈"])
should normalize_attribute(:other_names).from("foo foo").to(["foo"])
should normalize_attribute(:other_names).from("foo bar").to(["foo", "bar"])