mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 04:49:23 +00:00
Emoji: Only accept RGI emoji.
"recommended for general interchange"
This commit is contained in:
parent
3b3cf63118
commit
8fb259e739
|
@ -108,7 +108,10 @@ defmodule Pleroma.Emoji do
|
||||||
@external_resource
|
@external_resource
|
||||||
|> File.read!()
|
|> File.read!()
|
||||||
|> String.split("\n")
|
|> String.split("\n")
|
||||||
|> Enum.filter(fn line -> line != "" and not String.starts_with?(line, "#") end)
|
|> Enum.filter(fn line ->
|
||||||
|
line != "" and not String.starts_with?(line, "#") and
|
||||||
|
String.contains?(line, "fully-qualified")
|
||||||
|
end)
|
||||||
|> Enum.map(fn line ->
|
|> Enum.map(fn line ->
|
||||||
line
|
line
|
||||||
|> String.split(";", parts: 2)
|
|> String.split(";", parts: 2)
|
||||||
|
|
|
@ -11,7 +11,11 @@ defmodule Pleroma.EmojiTest do
|
||||||
refute Emoji.is_unicode_emoji?("X")
|
refute Emoji.is_unicode_emoji?("X")
|
||||||
refute Emoji.is_unicode_emoji?("ね")
|
refute Emoji.is_unicode_emoji?("ね")
|
||||||
|
|
||||||
assert Emoji.is_unicode_emoji?("☂")
|
# Only accept fully-qualified (RGI) emoji
|
||||||
|
# See http://www.unicode.org/reports/tr51/
|
||||||
|
refute Emoji.is_unicode_emoji?("❤")
|
||||||
|
refute Emoji.is_unicode_emoji?("☂")
|
||||||
|
|
||||||
assert Emoji.is_unicode_emoji?("🥺")
|
assert Emoji.is_unicode_emoji?("🥺")
|
||||||
assert Emoji.is_unicode_emoji?("🤰")
|
assert Emoji.is_unicode_emoji?("🤰")
|
||||||
assert Emoji.is_unicode_emoji?("❤️")
|
assert Emoji.is_unicode_emoji?("❤️")
|
||||||
|
|
Loading…
Reference in a new issue