#+feature dynamic-literals package markdown import "core:strings" EMOJIS: map[string]string = { // People "smile" = "๐Ÿ˜„", "laughing" = "๐Ÿ˜†", "blush" = "๐Ÿ˜Š", "smiley" = "๐Ÿ˜ƒ", "wink" = "๐Ÿ˜‰", "joy" = "๐Ÿ˜‚", "rofl" = "๐Ÿคฃ", "relaxed" = "โ˜บ๏ธ", "thinking" = "๐Ÿค”", "neutral_face" = "๐Ÿ˜", "expressionless" = "๐Ÿ˜‘", "no_mouth" = "๐Ÿ˜ถ", "rolling_eyes" = "๐Ÿ™„", "smirk" = "๐Ÿ˜", "persevere" = "๐Ÿ˜ฃ", "disappointed_relieved" = "๐Ÿ˜ฅ", "open_mouth" = "๐Ÿ˜ฎ", "zipper_mouth_face" = "๐Ÿค", "hushed" = "๐Ÿ˜ฏ", "sleepy" = "๐Ÿ˜ช", "tired_face" = "๐Ÿ˜ซ", "sleeping" = "๐Ÿ˜ด", "relieved" = "๐Ÿ˜Œ", "stuck_out_tongue" = "๐Ÿ˜›", "stuck_out_tongue_winking_eye" = "๐Ÿ˜œ", "stuck_out_tongue_closed_eyes" = "๐Ÿ˜", "drooling_face" = "๐Ÿคค", "unamused" = "๐Ÿ˜’", "sweat" = "๐Ÿ˜…", "pensive" = "๐Ÿ˜”", "confused" = "๐Ÿ˜•", "upside_down_face" = "๐Ÿ™ƒ", "money_mouth_face" = "๐Ÿค‘", "astonished" = "๐Ÿ˜ฒ", "white_frowning_face" = "โ˜น๏ธ", "slightly_sad_face" = "โ˜น๏ธ", "confounded" = "๐Ÿ˜–", "disappointed" = "๐Ÿ˜ž", "worried" = "๐Ÿ˜Ÿ", "triumph" = "๐Ÿ˜ค", "cry" = "๐Ÿ˜ข", "sob" = "๐Ÿ˜ญ", "frowning" = "๐Ÿ˜ฆ", "frowning_face" = "๐Ÿ™", "anguished" = "๐Ÿ˜ง", "fearful" = "๐Ÿ˜จ", "weary" = "๐Ÿ˜ฉ", "grimacing" = "๐Ÿ˜ฌ", "cold_sweat" = "๐Ÿ˜ฐ", "scream" = "๐Ÿ˜ฑ", "flushed" = "๐Ÿ˜ณ", "dizzy_face" = "๐Ÿ˜ต", "rage" = "๐Ÿ˜ก", "angry" = "๐Ÿ˜ ", "innocent" = "๐Ÿ˜‡", "cowboy_hat_face" = "๐Ÿค ", "clown_face" = "๐Ÿคก", "mask" = "๐Ÿ˜ท", "thermometer_face" = "๐Ÿค’", "head_bandage" = "๐Ÿค•", "nauseated_face" = "๐Ÿคข", "sneezing_face" = "๐Ÿคง", "smiling_imp" = "๐Ÿ˜ˆ", "imp" = "๐Ÿ‘ฟ", "shrug" = "ยฏ\\_(ใƒ„)_/ยฏ", "facepalm" = "๐Ÿคฆ", "facepunch" = "๐Ÿ‘Š", "wave" = "๐Ÿ‘‹", "ok_hand" = "๐Ÿ‘Œ", "thumbsup" = "๐Ÿ‘", "thumbsdown" = "๐Ÿ‘Ž", "clap" = "๐Ÿ‘", "pray" = "๐Ÿ™", "point_up" = "โ˜๏ธ", "point_down" = "๐Ÿ‘‡", "point_left" = "๐Ÿ‘ˆ", "point_right" = "๐Ÿ‘‰", "v" = "โœŒ๏ธ", "raised_hands" = "๐Ÿ™Œ", "muscle" = "๐Ÿ’ช", "fist" = "โœŠ", "hand" = "โœ‹", // Hearts & symbols "heart" = "โค๏ธ", "orange_heart" = "๐Ÿงก", "yellow_heart" = "๐Ÿ’›", "green_heart" = "๐Ÿ’š", "blue_heart" = "๐Ÿ’™", "purple_heart" = "๐Ÿ’œ", "broken_heart" = "๐Ÿ’”", "sparkling_heart" = "๐Ÿ’–", "100" = "๐Ÿ’ฏ", "anger" = "๐Ÿ’ข", "checkered_flag" = "๐Ÿ", "crossed_flags" = "๐Ÿšฉ", "rocket" = "๐Ÿš€", "star" = "โญ", "star2" = "๐ŸŒŸ", "sparkles" = "โœจ", "boom" = "๐Ÿ’ฅ", "exclamation" = "โ—", "question" = "โ“", "grey_exclamation" = "โ•", "grey_question" = "โ”", "zzz" = "๐Ÿ’ค", "warning" = "โš ๏ธ", "no_entry_sign" = "๐Ÿšซ", "no_entry" = "โ›”", "white_check_mark" = "โœ…", "negative_squared_cross_mark" = "โŽ", "x" = "โŒ", "o" = "โญ•", "heavy_plus_sign" = "โž•", "heavy_minus_sign" = "โž–", "heavy_division_sign" = "โž—", "copyright" = "ยฉ๏ธ", "registered" = "ยฎ๏ธ", "tm" = "โ„ข๏ธ", // Nature & weather "fire" = "๐Ÿ”ฅ", "zap" = "โšก", "sunny" = "โ˜€๏ธ", "cloud" = "โ˜๏ธ", "rainbow" = "๐ŸŒˆ", "snowflake" = "โ„๏ธ", "dash" = "๐Ÿ’จ", "tornado" = "๐ŸŒช๏ธ", "deciduous_tree" = "๐ŸŒณ", "evergreen_tree" = "๐ŸŒฒ", "palm_tree" = "๐ŸŒด", "cactus" = "๐ŸŒต", "tulip" = "๐ŸŒท", "rose" = "๐ŸŒน", "sunflower" = "๐ŸŒป", "hibiscus" = "๐ŸŒบ", "earth_africa" = "๐ŸŒ", "earth_americas" = "๐ŸŒŽ", "earth_asia" = "๐ŸŒ", "new_moon" = "๐ŸŒ‘", "full_moon" = "๐ŸŒ•", // Food & drink "coffee" = "โ˜•", "tea" = "๐Ÿต", "beer" = "๐Ÿบ", "beers" = "๐Ÿป", "wine_glass" = "๐Ÿท", "tropical_drink" = "๐Ÿน", "apple" = "๐ŸŽ", "green_apple" = "๐Ÿ", "orange" = "๐ŸŠ", "lemon" = "๐Ÿ‹", "banana" = "๐ŸŒ", "watermelon" = "๐Ÿ‰", "grapes" = "๐Ÿ‡", "strawberry" = "๐Ÿ“", "melon" = "๐Ÿˆ", "cherries" = "๐Ÿ’", "peach" = "๐Ÿ‘", "pineapple" = "๐Ÿ", "pizza" = "๐Ÿ•", "hamburger" = "๐Ÿ”", "hotdog" = "๐ŸŒญ", "taco" = "๐ŸŒฎ", "burrito" = "๐ŸŒฏ", "cake" = "๐Ÿฐ", "cookie" = "๐Ÿช", "chocolate_bar" = "๐Ÿซ", "candy" = "๐Ÿฌ", "popcorn" = "๐Ÿฟ", // Animals "dog" = "๐Ÿถ", "cat" = "๐Ÿฑ", "mouse" = "๐Ÿญ", "hamster" = "๐Ÿน", "rabbit" = "๐Ÿฐ", "bear" = "๐Ÿป", "panda_face" = "๐Ÿผ", "koala" = "๐Ÿจ", "tiger" = "๐Ÿฏ", "lion_face" = "๐Ÿฆ", "cow" = "๐Ÿฎ", "pig" = "๐Ÿท", "frog" = "๐Ÿธ", "monkey_face" = "๐Ÿต", "see_no_evil" = "๐Ÿ™ˆ", "hear_no_evil" = "๐Ÿ™‰", "speak_no_evil" = "๐Ÿ™Š", "owl" = "๐Ÿฆ‰", "bat" = "๐Ÿฆ‡", "wolf" = "๐Ÿบ", "boar" = "๐Ÿ—", "horse" = "๐Ÿด", "unicorn" = "๐Ÿฆ„", "honeybee" = "๐Ÿ", "bug" = "๐Ÿ›", "snail" = "๐ŸŒ", "beetle" = "๐Ÿž", "ant" = "๐Ÿœ", "spider" = "๐Ÿ•ท", "scorpion" = "๐Ÿฆ‚", "turtle" = "๐Ÿข", "snake" = "๐Ÿ", "octopus" = "๐Ÿ™", "shell" = "๐Ÿš", "whale" = "๐Ÿณ", "dolphin" = "๐Ÿฌ", "fish" = "๐ŸŸ", "tropical_fish" = "๐Ÿ ", "blowfish" = "๐Ÿก", "penguin" = "๐Ÿง", "chicken" = "๐Ÿ”", "bird" = "๐Ÿฆ", "eagle" = "๐Ÿฆ…", // Objects "computer" = "๐Ÿ’ป", "iphone" = "๐Ÿ“ฑ", "keyboard" = "โŒจ๏ธ", "desktop_computer" = "๐Ÿ–ฅ", "printer" = "๐Ÿ–จ", "mouse_three_button" = "๐Ÿ–ฑ", "joystick" = "๐Ÿ•น", "stash" = "๐Ÿ’พ", "floppy_disk" = "๐Ÿ’พ", "cd" = "๐Ÿ’ฟ", "dvd" = "๐Ÿ“€", "vhs" = "๐Ÿ“ผ", "camera" = "๐Ÿ“ท", "video_camera" = "๐Ÿ“น", "tv" = "๐Ÿ“บ", "radio" = "๐Ÿ“ป", "pager" = "๐Ÿ“Ÿ", "telephone" = "โ˜Ž๏ธ", "fax" = "๐Ÿ“ ", "bulb" = "๐Ÿ’ก", "candle" = "๐Ÿ•ฏ", "bathtub" = "๐Ÿ›", "shower" = "๐Ÿšฟ", "toilet" = "๐Ÿšฝ", "wrench" = "๐Ÿ”ง", "hammer" = "๐Ÿ”จ", "nut_and_bolt" = "๐Ÿ”ฉ", "gear" = "โš™๏ธ", "link" = "๐Ÿ”—", "lock" = "๐Ÿ”’", "unlock" = "๐Ÿ”“", "key" = "๐Ÿ”‘", "bell" = "๐Ÿ””", "bookmark" = "๐Ÿ”–", "pushpin" = "๐Ÿ“Œ", "paperclip" = "๐Ÿ“Ž", "memo" = "๐Ÿ“", "pencil2" = "โœ๏ธ", "black_nib" = "โœ’๏ธ", "pen" = "๐Ÿ–Š", "paintbrush" = "๐Ÿ–Œ", "crayon" = "๐Ÿ–", "book" = "๐Ÿ“–", "books" = "๐Ÿ“š", "ledger" = "๐Ÿ“’", "notebook" = "๐Ÿ““", "scroll" = "๐Ÿ“œ", "page_with_curl" = "๐Ÿ“„", "newspaper" = "๐Ÿ“ฐ", "chart_with_upwards_trend" = "๐Ÿ“ˆ", "chart_with_downwards_trend" = "๐Ÿ“‰", "bar_chart" = "๐Ÿ“Š", "calendar" = "๐Ÿ“…", "date" = "๐Ÿ“…", "hourglass" = "โŒ›", "hourglass_flowing_sand" = "โณ", "clock" = "๐Ÿ•", "alarm_clock" = "โฐ", "stopwatch" = "โฑ", "watch" = "โŒš", "moneybag" = "๐Ÿ’ฐ", "yen" = "๐Ÿ’ด", "dollar" = "๐Ÿ’ต", "euro" = "๐Ÿ’ถ", "pound" = "๐Ÿ’ท", "money_with_wings" = "๐Ÿ’ธ", "credit_card" = "๐Ÿ’ณ", "gem" = "๐Ÿ’Ž", "bomb" = "๐Ÿ’ฃ", "gift" = "๐ŸŽ", "balloon" = "๐ŸŽˆ", "tada" = "๐ŸŽ‰", "confetti_ball" = "๐ŸŽŠ", "package" = "๐Ÿ“ฆ", "mailbox" = "๐Ÿ“ซ", "inbox_tray" = "๐Ÿ“ฅ", "outbox_tray" = "๐Ÿ“ค", "email" = "โœ‰๏ธ", "envelope" = "โœ‰๏ธ", "incoming_envelope" = "๐Ÿ“จ", // Activities "soccer" = "โšฝ", "basketball" = "๐Ÿ€", "football" = "๐Ÿˆ", "baseball" = "โšพ", "tennis" = "๐ŸŽพ", "8ball" = "๐ŸŽฑ", "bowling" = "๐ŸŽณ", "video_game" = "๐ŸŽฎ", "dart" = "๐ŸŽฏ", "game_die" = "๐ŸŽฒ", "slot_machine" = "๐ŸŽฐ", "cards" = "๐Ÿƒ", "black_joker" = "๐ŸƒŸ", "mahjong" = "๐Ÿ€„", "musical_note" = "๐ŸŽต", "notes" = "๐ŸŽถ", "saxophone" = "๐ŸŽท", "guitar" = "๐ŸŽธ", "musical_keyboard" = "๐ŸŽน", "trumpet" = "๐ŸŽบ", "violin" = "๐ŸŽป", "drum" = "๐Ÿฅ", "headphones" = "๐ŸŽง", "microphone" = "๐ŸŽค", "level_slider" = "๐ŸŽš", "control_knobs" = "๐ŸŽ›", "ticket" = "๐ŸŽซ", "art" = "๐ŸŽจ", "circus_tent" = "๐ŸŽช", "theater_masks" = "๐ŸŽญ", "clapper" = "๐ŸŽฌ", // Travel "car" = "๐Ÿš—", "taxi" = "๐Ÿš•", "bus" = "๐Ÿš", "train" = "๐Ÿš†", "metro" = "๐Ÿš‡", "light_rail" = "๐Ÿšˆ", "tram" = "๐ŸšŠ", "bike" = "๐Ÿšฒ", "motorcycle" = "๐Ÿ", "airplane" = "โœˆ๏ธ", "helicopter" = "๐Ÿš", "boat" = "โ›ต", "sailboat" = "โ›ต", "ship" = "๐Ÿšข", "fuelpump" = "โ›ฝ", "construction" = "๐Ÿšง", "house" = "๐Ÿ ", "house_with_garden" = "๐Ÿก", "office" = "๐Ÿข", "post_office" = "๐Ÿฃ", "hospital" = "๐Ÿฅ", "bank" = "๐Ÿฆ", "hotel" = "๐Ÿจ", "school" = "๐Ÿซ", "department_store" = "๐Ÿฌ", "church" = "โ›ช", "castle" = "๐Ÿฐ", "factory" = "๐Ÿญ", "tokyo_tower" = "๐Ÿ—ผ", "statue_of_liberty" = "๐Ÿ—ฝ", "fountain" = "โ›ฒ", "tent" = "โ›บ", "mountain" = "โ›ฐ๏ธ", "snow_capped_mountain" = "๐Ÿ”", "beach" = "๐Ÿ–", "camping" = "๐Ÿ•", "world_map" = "๐Ÿ—บ", "japan" = "๐Ÿ—พ", } expand_emoji :: proc(text: string) -> string { assert(len(EMOJIS) > 0) sb := strings.builder_make() defer strings.builder_destroy(&sb) remaining := text for { colon := strings.index(remaining, ":") if colon < 0 { strings.write_string(&sb, remaining) break } after := remaining[colon + 1:] end := strings.index(after, ":") if end < 0 { strings.write_string(&sb, remaining) break } shortcode := remaining[colon + 1:colon + 1 + end] valid := true for c in shortcode { if !(c >= 'a' && c <= 'z') && !(c >= '0' && c <= '9') && c != '_' && c != '+' && c != '-' { valid = false break } } if !valid || len(shortcode) == 0 { strings.write_string(&sb, remaining[:colon + 1]) remaining = remaining[colon + 1:] continue } emoji, found := EMOJIS[shortcode] if !found { strings.write_string(&sb, remaining[:colon + 1]) remaining = remaining[colon + 1:] continue } strings.write_string(&sb, remaining[:colon]) strings.write_string(&sb, emoji) remaining = remaining[colon + 1 + end + 1:] } return strings.to_string(sb) }