Emoji mappings - Exclude Emoji #372

Closed
opened 2026-01-29 14:35:13 +00:00 by claunia · 2 comments
Owner

Originally created by @LukeTOBrien on GitHub (Jun 9, 2020).

Hello there,

I am creating an app and I want it to be safe for kids, I want to use Emoji but I need to exclude to middle finger Emoji.
So basicly I want to call the Emoji extension with a string array of Emoji to exclude.
Do you see what I mean and is this currently possible?
I notice that the extension has a public constructor that takes an
EmojiMapping: public EmojiExtension(EmojiMapping emojiMapping).
Do you think I could somehow use that with code like:

EmojiMapping.GetDefaultEmojiShortcodeToUnicode()
  .Where(kv => !excludedList.Contains(kv.Key))

I don't know why anyone on the Emoji standards commity would approve a middle finger emoji anyway,

I also wondered if you considered storing the default Emoji mapping in a embedded resourse like a JSON or YAML file?
I think it would be easier to maintain and in the future you might consider a more complex object rather than a Dictionary<string, string>, like alternative shortnames or skin colour variations.

Originally created by @LukeTOBrien on GitHub (Jun 9, 2020). Hello there, I am creating an app and I want it to be safe for kids, I want to use Emoji but I need to exclude to middle finger Emoji. So basicly I want to call the Emoji extension with a string array of Emoji to exclude. Do you see what I mean and is this currently possible? I notice that the extension has a public constructor that takes an `EmojiMapping`: ` public EmojiExtension(EmojiMapping emojiMapping)`. Do you think I could somehow use that with code like: ```csharp EmojiMapping.GetDefaultEmojiShortcodeToUnicode() .Where(kv => !excludedList.Contains(kv.Key)) ``` I don't know why anyone on the Emoji standards commity would approve a middle finger emoji anyway, I also wondered if you considered storing the default Emoji mapping in a embedded resourse like a JSON or YAML file? I think it would be easier to maintain and in the future you might consider a more complex object rather than a `Dictionary<string, string>`, like alternative shortnames or skin colour variations.
claunia added the question label 2026-01-29 14:35:13 +00:00
Author
Owner

@MihaZupan commented on GitHub (Jun 9, 2020):

You can create a custom EmojiMapping

IDictionary<string, string> shortcodeToUnicode = EmojiMapping.GetDefaultEmojiShortcodeToUnicode();
shortcodeToUnicode.Remove(":middle_finger:");

builder.Use(new EmojiExtension(new EmojiMapping(
    shortcodeToUnicode,
    EmojiMapping.GetDefaultSmileyToEmojiShortcode())));
@MihaZupan commented on GitHub (Jun 9, 2020): You can create a custom EmojiMapping ```c# IDictionary<string, string> shortcodeToUnicode = EmojiMapping.GetDefaultEmojiShortcodeToUnicode(); shortcodeToUnicode.Remove(":middle_finger:"); builder.Use(new EmojiExtension(new EmojiMapping( shortcodeToUnicode, EmojiMapping.GetDefaultSmileyToEmojiShortcode()))); ```
Author
Owner

@LukeTOBrien commented on GitHub (Jun 11, 2020):

Thank you very much 8-)

Shortcodes not working in GutHub

@LukeTOBrien commented on GitHub (Jun 11, 2020): Thank you very much 8-) > Shortcodes not working in GutHub
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#372