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:
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user