diff --git a/src/markdown/emoji.rs b/src/markdown/emoji.rs new file mode 100644 index 0000000..423d6d0 --- /dev/null +++ b/src/markdown/emoji.rs @@ -0,0 +1,910 @@ +use std::collections::HashMap; +use std::sync::LazyLock; + +static EMOJIS: LazyLock> = LazyLock::new(|| { + HashMap::from([ + ("bowtie", "๐Ÿ™‡"), + ("smile", "๐Ÿ˜„"), + ("laughing", "๐Ÿ˜†"), + ("blush", "๐Ÿ˜Š"), + ("smiley", "๐Ÿ˜ƒ"), + ("relaxed", "โ˜บ๏ธ"), + ("smirk", "๐Ÿ˜"), + ("heart_eyes", "๐Ÿ˜"), + ("kissing_heart", "๐Ÿ˜˜"), + ("kissing_closed_eyes", "๐Ÿ˜š"), + ("flushed", "๐Ÿ˜ณ"), + ("relieved", "๐Ÿ˜Œ"), + ("satisfied", "๐Ÿ˜Œ"), + ("grin", "๐Ÿ˜"), + ("wink", "๐Ÿ˜‰"), + ("stuck_out_tongue_winking_eye", "๐Ÿ˜œ"), + ("stuck_out_tongue_closed_eyes", "๐Ÿ˜"), + ("grinning", "๐Ÿ˜€"), + ("kissing", "๐Ÿ˜—"), + ("kissing_smiling_eyes", "๐Ÿ˜™"), + ("stuck_out_tongue", "๐Ÿ˜›"), + ("sleeping", "๐Ÿ˜ด"), + ("worried", "๐Ÿ˜Ÿ"), + ("frowning", "๐Ÿ˜ฆ"), + ("anguished", "๐Ÿ˜ง"), + ("open_mouth", "๐Ÿ˜ฎ"), + ("grimacing", "๐Ÿ˜ฌ"), + ("confused", "๐Ÿ˜•"), + ("hushed", "๐Ÿ˜ฏ"), + ("expressionless", "๐Ÿ˜‘"), + ("unamused", "๐Ÿ˜’"), + ("sweat_smile", "๐Ÿ˜…"), + ("sweat", "๐Ÿ˜“"), + ("disappointed_relieved", "๐Ÿ˜ฅ"), + ("weary", "๐Ÿ˜ฉ"), + ("pensive", "๐Ÿ˜”"), + ("disappointed", "๐Ÿ˜ž"), + ("confounded", "๐Ÿ˜–"), + ("fearful", "๐Ÿ˜จ"), + ("cold_sweat", "๐Ÿ˜ฐ"), + ("persevere", "๐Ÿ˜ฃ"), + ("cry", "๐Ÿ˜ข"), + ("sob", "๐Ÿ˜ญ"), + ("joy", "๐Ÿ˜‚"), + ("astonished", "๐Ÿ˜ฒ"), + ("scream", "๐Ÿ˜ฑ"), + ("neckbeard", "๐Ÿง”"), + ("tired_face", "๐Ÿ˜ซ"), + ("angry", "๐Ÿ˜ "), + ("rage", "๐Ÿ˜ก"), + ("triumph", "๐Ÿ˜ค"), + ("sleepy", "๐Ÿ˜ช"), + ("yum", "๐Ÿ˜‹"), + ("mask", "๐Ÿ˜ท"), + ("sunglasses", "๐Ÿ˜Ž"), + ("dizzy_face", "๐Ÿ˜ต"), + ("imp", "๐Ÿ‘ฟ"), + ("smiling_imp", "๐Ÿ˜ˆ"), + ("neutral_face", "๐Ÿ˜"), + ("no_mouth", "๐Ÿ˜ถ"), + ("innocent", "๐Ÿ˜‡"), + ("alien", "๐Ÿ‘ฝ"), + ("yellow_heart", "๐Ÿ’›"), + ("blue_heart", "๐Ÿ’™"), + ("purple_heart", "๐Ÿ’œ"), + ("heart", "โค๏ธ"), + ("green_heart", "๐Ÿ’š"), + ("broken_heart", "๐Ÿ’”"), + ("heartbeat", "๐Ÿ’“"), + ("heartpulse", "๐Ÿ’—"), + ("two_hearts", "๐Ÿ’•"), + ("revolving_hearts", "๐Ÿ’ž"), + ("cupid", "๐Ÿ’˜"), + ("sparkling_heart", "๐Ÿ’–"), + ("sparkles", "โœจ"), + ("star", "โญ"), + ("star2", "๐ŸŒŸ"), + ("dizzy", "๐Ÿ’ซ"), + ("boom", "๐Ÿ’ฅ"), + ("collision", "๐Ÿ’ฅ"), + ("anger", "๐Ÿ’ข"), + ("exclamation", "โ—"), + ("question", "โ“"), + ("grey_exclamation", "โ•"), + ("grey_question", "โ”"), + ("zzz", "๐Ÿ’ค"), + ("dash", "๐Ÿ’จ"), + ("sweat_drops", "๐Ÿ’ฆ"), + ("notes", "๐ŸŽถ"), + ("musical_note", "๐ŸŽต"), + ("fire", "๐Ÿ”ฅ"), + ("hankey", "๐Ÿ’ฉ"), + ("poop", "๐Ÿ’ฉ"), + ("shit", "๐Ÿ’ฉ"), + ("+1", "๐Ÿ‘"), + ("thumbsup", "๐Ÿ‘"), + ("-1", "๐Ÿ‘Ž"), + ("thumbsdown", "๐Ÿ‘Ž"), + ("ok_hand", "๐Ÿ‘Œ"), + ("punch", "๐Ÿ‘Š"), + ("facepunch", "๐Ÿ‘Š"), + ("fist", "โœŠ"), + ("v", "โœŒ๏ธ"), + ("wave", "๐Ÿ‘‹"), + ("hand", "โœ‹"), + ("raised_hand", "โœ‹"), + ("open_hands", "๐Ÿ‘"), + ("point_up", "โ˜๏ธ"), + ("point_down", "๐Ÿ‘‡"), + ("point_left", "๐Ÿ‘ˆ"), + ("point_right", "๐Ÿ‘‰"), + ("raised_hands", "๐Ÿ™Œ"), + ("pray", "๐Ÿ™"), + ("point_up_2", "๐Ÿ‘†"), + ("clap", "๐Ÿ‘"), + ("muscle", "๐Ÿ’ช"), + ("metal", "๐Ÿค˜"), + ("fu", "๐Ÿ–•"), + ("walking", "๐Ÿšถ"), + ("runner", "๐Ÿƒ"), + ("running", "๐Ÿƒ"), + ("couple", "๐Ÿ‘ซ"), + ("family", "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ"), + ("two_men_holding_hands", "๐Ÿ‘ฌ"), + ("two_women_holding_hands", "๐Ÿ‘ญ"), + ("dancer", "๐Ÿ’ƒ"), + ("dancers", "๐Ÿ‘ฏ"), + ("ok_woman", "๐Ÿ™†"), + ("no_good", "๐Ÿ™…"), + ("information_desk_person", "๐Ÿ’"), + ("raising_hand", "๐Ÿ™‹"), + ("bride_with_veil", "๐Ÿ‘ฐ"), + ("person_with_pouting_face", "๐Ÿ™Ž"), + ("person_frowning", "๐Ÿ™"), + ("bow", "๐Ÿ™‡"), + ("couplekiss", "๐Ÿ’"), + ("couple_with_heart", "๐Ÿ’‘"), + ("massage", "๐Ÿ’†"), + ("haircut", "๐Ÿ’‡"), + ("nail_care", "๐Ÿ’…"), + ("boy", "๐Ÿ‘ฆ"), + ("girl", "๐Ÿ‘ง"), + ("woman", "๐Ÿ‘ฉ"), + ("man", "๐Ÿ‘จ"), + ("baby", "๐Ÿ‘ถ"), + ("older_woman", "๐Ÿ‘ต"), + ("older_man", "๐Ÿ‘ด"), + ("person_with_blond_hair", "๐Ÿ‘ฑ"), + ("man_with_gua_pi_mao", "๐Ÿ‘ฒ"), + ("man_with_turban", "๐Ÿ‘ณ"), + ("construction_worker", "๐Ÿ‘ท"), + ("cop", "๐Ÿ‘ฎ"), + ("angel", "๐Ÿ‘ผ"), + ("princess", "๐Ÿ‘ธ"), + ("smiley_cat", "๐Ÿ˜บ"), + ("smile_cat", "๐Ÿ˜ธ"), + ("heart_eyes_cat", "๐Ÿ˜ป"), + ("kissing_cat", "๐Ÿ˜ฝ"), + ("smirk_cat", "๐Ÿ˜ผ"), + ("scream_cat", "๐Ÿ™€"), + ("crying_cat_face", "๐Ÿ˜ฟ"), + ("joy_cat", "๐Ÿ˜น"), + ("pouting_cat", "๐Ÿ˜พ"), + ("japanese_ogre", "๐Ÿ‘น"), + ("japanese_goblin", "๐Ÿ‘บ"), + ("see_no_evil", "๐Ÿ™ˆ"), + ("hear_no_evil", "๐Ÿ™‰"), + ("speak_no_evil", "๐Ÿ™Š"), + ("guardsman", "๐Ÿ’‚"), + ("skull", "๐Ÿ’€"), + ("feet", "๐Ÿพ"), + ("lips", "๐Ÿ‘„"), + ("kiss", "๐Ÿ’‹"), + ("droplet", "๐Ÿ’ง"), + ("ear", "๐Ÿ‘‚"), + ("eyes", "๐Ÿ‘€"), + ("nose", "๐Ÿ‘ƒ"), + ("tongue", "๐Ÿ‘…"), + ("love_letter", "๐Ÿ’Œ"), + ("bust_in_silhouette", "๐Ÿ‘ค"), + ("busts_in_silhouette", "๐Ÿ‘ฅ"), + ("speech_balloon", "๐Ÿ’ฌ"), + ("thought_balloon", "๐Ÿ’ญ"), + ("feelsgood", "๐Ÿ˜Ž"), + ("finnadie", "๐Ÿ˜ต"), + ("goberserk", "๐Ÿ˜ˆ"), + ("godmode", "๐Ÿ˜‡"), + ("hurtrealbad", "๐Ÿ˜ฐ"), + ("rage1", "๐Ÿ˜ก"), + ("rage2", "๐Ÿ˜ก"), + ("rage3", "๐Ÿ˜ก"), + ("rage4", "๐Ÿ˜ก"), + ("suspect", "๐Ÿ˜•"), + ("trollface", "๐Ÿ˜‚"), + // Nature + ("sunny", "โ˜€๏ธ"), + ("umbrella", "โ˜‚๏ธ"), + ("cloud", "โ˜๏ธ"), + ("snowflake", "โ„๏ธ"), + ("snowman", "โ›„"), + ("zap", "โšก"), + ("cyclone", "๐ŸŒ€"), + ("foggy", "๐ŸŒ"), + ("ocean", "๐ŸŒŠ"), + ("cat", "๐Ÿฑ"), + ("dog", "๐Ÿถ"), + ("mouse", "๐Ÿญ"), + ("hamster", "๐Ÿน"), + ("rabbit", "๐Ÿฐ"), + ("wolf", "๐Ÿบ"), + ("frog", "๐Ÿธ"), + ("tiger", "๐Ÿฏ"), + ("koala", "๐Ÿจ"), + ("bear", "๐Ÿป"), + ("pig", "๐Ÿท"), + ("pig_nose", "๐Ÿฝ"), + ("cow", "๐Ÿฎ"), + ("boar", "๐Ÿ—"), + ("monkey_face", "๐Ÿต"), + ("monkey", "๐Ÿ’"), + ("horse", "๐Ÿด"), + ("racehorse", "๐ŸŽ"), + ("camel", "๐Ÿซ"), + ("sheep", "๐Ÿ‘"), + ("elephant", "๐Ÿ˜"), + ("panda_face", "๐Ÿผ"), + ("snake", "๐Ÿ"), + ("bird", "๐Ÿฆ"), + ("baby_chick", "๐Ÿค"), + ("hatched_chick", "๐Ÿฅ"), + ("hatching_chick", "๐Ÿฃ"), + ("chicken", "๐Ÿ”"), + ("penguin", "๐Ÿง"), + ("turtle", "๐Ÿข"), + ("bug", "๐Ÿ›"), + ("honeybee", "๐Ÿ"), + ("ant", "๐Ÿœ"), + ("beetle", "๐Ÿž"), + ("snail", "๐ŸŒ"), + ("octopus", "๐Ÿ™"), + ("tropical_fish", "๐Ÿ "), + ("fish", "๐ŸŸ"), + ("whale", "๐Ÿณ"), + ("whale2", "๐Ÿ‹"), + ("dolphin", "๐Ÿฌ"), + ("cow2", "๐Ÿ„"), + ("ram", "๐Ÿ"), + ("rat", "๐Ÿ€"), + ("water_buffalo", "๐Ÿƒ"), + ("tiger2", "๐Ÿ…"), + ("rabbit2", "๐Ÿ‡"), + ("dragon", "๐Ÿ‰"), + ("goat", "๐Ÿ"), + ("rooster", "๐Ÿ“"), + ("dog2", "๐Ÿ•"), + ("pig2", "๐Ÿ–"), + ("mouse2", "๐Ÿ"), + ("ox", "๐Ÿ‚"), + ("dragon_face", "๐Ÿฒ"), + ("blowfish", "๐Ÿก"), + ("crocodile", "๐ŸŠ"), + ("dromedary_camel", "๐Ÿช"), + ("leopard", "๐Ÿ†"), + ("cat2", "๐Ÿˆ"), + ("poodle", "๐Ÿฉ"), + ("paw_prints", "๐Ÿพ"), + ("bouquet", "๐Ÿ’"), + ("cherry_blossom", "๐ŸŒธ"), + ("tulip", "๐ŸŒท"), + ("four_leaf_clover", "๐Ÿ€"), + ("rose", "๐ŸŒน"), + ("sunflower", "๐ŸŒป"), + ("hibiscus", "๐ŸŒบ"), + ("maple_leaf", "๐Ÿ"), + ("leaves", "๐Ÿƒ"), + ("fallen_leaf", "๐Ÿ‚"), + ("herb", "๐ŸŒฟ"), + ("mushroom", "๐Ÿ„"), + ("cactus", "๐ŸŒต"), + ("palm_tree", "๐ŸŒด"), + ("evergreen_tree", "๐ŸŒฒ"), + ("deciduous_tree", "๐ŸŒณ"), + ("chestnut", "๐ŸŒฐ"), + ("seedling", "๐ŸŒฑ"), + ("blossom", "๐ŸŒผ"), + ("ear_of_rice", "๐ŸŒพ"), + ("shell", "๐Ÿš"), + ("globe_with_meridians", "๐ŸŒ"), + ("sun_with_face", "๐ŸŒž"), + ("full_moon_with_face", "๐ŸŒ"), + ("new_moon_with_face", "๐ŸŒš"), + ("new_moon", "๐ŸŒ‘"), + ("waxing_crescent_moon", "๐ŸŒ’"), + ("first_quarter_moon", "๐ŸŒ“"), + ("waxing_gibbous_moon", "๐ŸŒ”"), + ("full_moon", "๐ŸŒ•"), + ("waning_gibbous_moon", "๐ŸŒ–"), + ("last_quarter_moon", "๐ŸŒ—"), + ("waning_crescent_moon", "๐ŸŒ˜"), + ("last_quarter_moon_with_face", "๐ŸŒœ"), + ("first_quarter_moon_with_face", "๐ŸŒ›"), + ("moon", "๐ŸŒ™"), + ("earth_africa", "๐ŸŒ"), + ("earth_americas", "๐ŸŒŽ"), + ("earth_asia", "๐ŸŒ"), + ("volcano", "๐ŸŒ‹"), + ("milky_way", "๐ŸŒŒ"), + ("partly_sunny", "โ›…"), + ("octocat", "๐Ÿ™"), + ("squirrel", "๐Ÿฟ๏ธ"), + // Objects + ("bamboo", "๐ŸŽ"), + ("gift_heart", "๐Ÿ’"), + ("dolls", "๐ŸŽŽ"), + ("school_satchel", "๐ŸŽ’"), + ("mortar_board", "๐ŸŽ“"), + ("flags", "๐ŸŽ"), + ("fireworks", "๐ŸŽ†"), + ("sparkler", "๐ŸŽ‡"), + ("wind_chime", "๐ŸŽ"), + ("rice_scene", "๐ŸŽ‘"), + ("jack_o_lantern", "๐ŸŽƒ"), + ("ghost", "๐Ÿ‘ป"), + ("santa", "๐ŸŽ…"), + ("christmas_tree", "๐ŸŽ„"), + ("gift", "๐ŸŽ"), + ("bell", "๐Ÿ””"), + ("no_bell", "๐Ÿ”•"), + ("tanabata_tree", "๐ŸŽ‹"), + ("tada", "๐ŸŽ‰"), + ("confetti_ball", "๐ŸŽŠ"), + ("balloon", "๐ŸŽˆ"), + ("crystal_ball", "๐Ÿ”ฎ"), + ("cd", "๐Ÿ’ฟ"), + ("dvd", "๐Ÿ“€"), + ("floppy_disk", "๐Ÿ’พ"), + ("camera", "๐Ÿ“ท"), + ("video_camera", "๐Ÿ“น"), + ("movie_camera", "๐ŸŽฅ"), + ("computer", "๐Ÿ’ป"), + ("tv", "๐Ÿ“บ"), + ("iphone", "๐Ÿ“ฑ"), + ("phone", "๐Ÿ“ž"), + ("telephone", "โ˜Ž๏ธ"), + ("telephone_receiver", "๐Ÿ“ž"), + ("pager", "๐Ÿ“Ÿ"), + ("fax", "๐Ÿ“ "), + ("minidisc", "๐Ÿ’ฝ"), + ("vhs", "๐Ÿ“ผ"), + ("sound", "๐Ÿ”Š"), + ("speaker", "๐Ÿ”ˆ"), + ("mute", "๐Ÿ”‡"), + ("loudspeaker", "๐Ÿ“ข"), + ("mega", "๐Ÿ“ฃ"), + ("hourglass", "โŒ›"), + ("hourglass_flowing_sand", "โณ"), + ("alarm_clock", "โฐ"), + ("watch", "โŒš"), + ("radio", "๐Ÿ“ป"), + ("satellite", "๐Ÿ“ก"), + ("loop", "โžฐ"), + ("mag", "๐Ÿ”"), + ("mag_right", "๐Ÿ”Ž"), + ("unlock", "๐Ÿ”“"), + ("lock", "๐Ÿ”’"), + ("lock_with_ink_pen", "๐Ÿ”"), + ("closed_lock_with_key", "๐Ÿ”"), + ("key", "๐Ÿ”‘"), + ("bulb", "๐Ÿ’ก"), + ("flashlight", "๐Ÿ”ฆ"), + ("high_brightness", "๐Ÿ”†"), + ("low_brightness", "๐Ÿ”…"), + ("electric_plug", "๐Ÿ”Œ"), + ("battery", "๐Ÿ”‹"), + ("calling", "๐Ÿ“ฒ"), + ("email", "๐Ÿ“ง"), + ("mailbox", "๐Ÿ“ซ"), + ("postbox", "๐Ÿ“ฎ"), + ("bath", "๐Ÿ›€"), + ("bathtub", "๐Ÿ›"), + ("shower", "๐Ÿšฟ"), + ("toilet", "๐Ÿšฝ"), + ("wrench", "๐Ÿ”ง"), + ("nut_and_bolt", "๐Ÿ”ฉ"), + ("hammer", "๐Ÿ”จ"), + ("seat", "๐Ÿ’บ"), + ("moneybag", "๐Ÿ’ฐ"), + ("yen", "๐Ÿ’ด"), + ("dollar", "๐Ÿ’ต"), + ("pound", "๐Ÿ’ท"), + ("euro", "๐Ÿ’ถ"), + ("credit_card", "๐Ÿ’ณ"), + ("money_with_wings", "๐Ÿ’ธ"), + ("e-mail", "๐Ÿ“ง"), + ("inbox_tray", "๐Ÿ“ฅ"), + ("outbox_tray", "๐Ÿ“ค"), + ("envelope", "โœ‰๏ธ"), + ("incoming_envelope", "๐Ÿ“จ"), + ("postal_horn", "๐Ÿ“ฏ"), + ("mailbox_closed", "๐Ÿ“ช"), + ("mailbox_with_mail", "๐Ÿ“ฌ"), + ("mailbox_with_no_mail", "๐Ÿ“ญ"), + ("door", "๐Ÿšช"), + ("smoking", "๐Ÿšฌ"), + ("bomb", "๐Ÿ’ฃ"), + ("gun", "๐Ÿ”ซ"), + ("hocho", "๐Ÿ”ช"), + ("pill", "๐Ÿ’Š"), + ("syringe", "๐Ÿ’‰"), + ("page_facing_up", "๐Ÿ“„"), + ("page_with_curl", "๐Ÿ“ƒ"), + ("bookmark_tabs", "๐Ÿ“‘"), + ("bar_chart", "๐Ÿ“Š"), + ("chart_with_upwards_trend", "๐Ÿ“ˆ"), + ("chart_with_downwards_trend", "๐Ÿ“‰"), + ("scroll", "๐Ÿ“œ"), + ("clipboard", "๐Ÿ“‹"), + ("calendar", "๐Ÿ“…"), + ("date", "๐Ÿ“†"), + ("card_index", "๐Ÿ“‡"), + ("file_folder", "๐Ÿ“"), + ("open_file_folder", "๐Ÿ“‚"), + ("scissors", "โœ‚๏ธ"), + ("pushpin", "๐Ÿ“Œ"), + ("paperclip", "๐Ÿ“Ž"), + ("black_nib", "โœ’๏ธ"), + ("pencil2", "โœ๏ธ"), + ("straight_ruler", "๐Ÿ“"), + ("triangular_ruler", "๐Ÿ“"), + ("closed_book", "๐Ÿ“•"), + ("green_book", "๐Ÿ“—"), + ("blue_book", "๐Ÿ“˜"), + ("orange_book", "๐Ÿ“™"), + ("notebook", "๐Ÿ““"), + ("notebook_with_decorative_cover", "๐Ÿ“”"), + ("ledger", "๐Ÿ“’"), + ("books", "๐Ÿ“š"), + ("bookmark", "๐Ÿ”–"), + ("name_badge", "๐Ÿ“›"), + ("microscope", "๐Ÿ”ฌ"), + ("telescope", "๐Ÿ”ญ"), + ("newspaper", "๐Ÿ“ฐ"), + ("football", "๐Ÿˆ"), + ("basketball", "๐Ÿ€"), + ("soccer", "โšฝ"), + ("baseball", "โšพ"), + ("tennis", "๐ŸŽพ"), + ("8ball", "๐ŸŽฑ"), + ("rugby_football", "๐Ÿ‰"), + ("bowling", "๐ŸŽณ"), + ("golf", "โ›ณ"), + ("mountain_bicyclist", "๐Ÿšต"), + ("bicyclist", "๐Ÿšด"), + ("horse_racing", "๐Ÿ‡"), + ("snowboarder", "๐Ÿ‚"), + ("swimmer", "๐ŸŠ"), + ("surfer", "๐Ÿ„"), + ("ski", "โ›ท๏ธ"), + ("spades", "โ™ ๏ธ"), + ("hearts", "โ™ฅ๏ธ"), + ("clubs", "โ™ฃ๏ธ"), + ("diamonds", "โ™ฆ๏ธ"), + ("gem", "๐Ÿ’Ž"), + ("ring", "๐Ÿ’"), + ("trophy", "๐Ÿ†"), + ("musical_score", "๐ŸŽผ"), + ("musical_keyboard", "๐ŸŽน"), + ("violin", "๐ŸŽป"), + ("space_invader", "๐Ÿ‘พ"), + ("video_game", "๐ŸŽฎ"), + ("black_joker", "๐Ÿƒ"), + ("flower_playing_cards", "๐ŸŽด"), + ("game_die", "๐ŸŽฒ"), + ("dart", "๐ŸŽฏ"), + ("mahjong", "๐Ÿ€„"), + ("clapper", "๐ŸŽฌ"), + ("memo", "๐Ÿ“"), + ("pencil", "๐Ÿ“"), + ("book", "๐Ÿ“–"), + ("art", "๐ŸŽจ"), + ("microphone", "๐ŸŽค"), + ("headphones", "๐ŸŽง"), + ("trumpet", "๐ŸŽบ"), + ("saxophone", "๐ŸŽท"), + ("guitar", "๐ŸŽธ"), + ("shoe", "๐Ÿ‘ž"), + ("sandal", "๐Ÿ‘ก"), + ("high_heel", "๐Ÿ‘ "), + ("lipstick", "๐Ÿ’„"), + ("boot", "๐Ÿ‘ข"), + ("shirt", "๐Ÿ‘•"), + ("tshirt", "๐Ÿ‘•"), + ("necktie", "๐Ÿ‘”"), + ("womans_clothes", "๐Ÿ‘š"), + ("dress", "๐Ÿ‘—"), + ("running_shirt_with_sash", "๐ŸŽฝ"), + ("jeans", "๐Ÿ‘–"), + ("kimono", "๐Ÿ‘˜"), + ("bikini", "๐Ÿ‘™"), + ("ribbon", "๐ŸŽ€"), + ("tophat", "๐ŸŽฉ"), + ("crown", "๐Ÿ‘‘"), + ("womans_hat", "๐Ÿ‘’"), + ("mans_shoe", "๐Ÿ‘ž"), + ("closed_umbrella", "๐ŸŒ‚"), + ("briefcase", "๐Ÿ’ผ"), + ("handbag", "๐Ÿ‘œ"), + ("pouch", "๐Ÿ‘"), + ("purse", "๐Ÿ‘›"), + ("eyeglasses", "๐Ÿ‘“"), + ("fishing_pole_and_fish", "๐ŸŽฃ"), + ("coffee", "โ˜•"), + ("tea", "๐Ÿต"), + ("sake", "๐Ÿถ"), + ("baby_bottle", "๐Ÿผ"), + ("beer", "๐Ÿบ"), + ("beers", "๐Ÿป"), + ("cocktail", "๐Ÿธ"), + ("tropical_drink", "๐Ÿน"), + ("wine_glass", "๐Ÿท"), + ("fork_and_knife", "๐Ÿด"), + ("pizza", "๐Ÿ•"), + ("hamburger", "๐Ÿ”"), + ("fries", "๐ŸŸ"), + ("poultry_leg", "๐Ÿ—"), + ("meat_on_bone", "๐Ÿ–"), + ("spaghetti", "๐Ÿ"), + ("curry", "๐Ÿ›"), + ("fried_shrimp", "๐Ÿค"), + ("bento", "๐Ÿฑ"), + ("sushi", "๐Ÿฃ"), + ("fish_cake", "๐Ÿฅ"), + ("rice_ball", "๐Ÿ™"), + ("rice_cracker", "๐Ÿ˜"), + ("rice", "๐Ÿš"), + ("ramen", "๐Ÿœ"), + ("stew", "๐Ÿฒ"), + ("oden", "๐Ÿข"), + ("dango", "๐Ÿก"), + ("egg", "๐Ÿณ"), + ("bread", "๐Ÿž"), + ("doughnut", "๐Ÿฉ"), + ("custard", "๐Ÿฎ"), + ("icecream", "๐Ÿฆ"), + ("ice_cream", "๐Ÿจ"), + ("shaved_ice", "๐Ÿง"), + ("birthday", "๐ŸŽ‚"), + ("cake", "๐Ÿฐ"), + ("cookie", "๐Ÿช"), + ("chocolate_bar", "๐Ÿซ"), + ("candy", "๐Ÿฌ"), + ("lollipop", "๐Ÿญ"), + ("honey_pot", "๐Ÿฏ"), + ("apple", "๐ŸŽ"), + ("green_apple", "๐Ÿ"), + ("tangerine", "๐ŸŠ"), + ("lemon", "๐Ÿ‹"), + ("cherries", "๐Ÿ’"), + ("grapes", "๐Ÿ‡"), + ("watermelon", "๐Ÿ‰"), + ("strawberry", "๐Ÿ“"), + ("peach", "๐Ÿ‘"), + ("melon", "๐Ÿˆ"), + ("banana", "๐ŸŒ"), + ("pear", "๐Ÿ"), + ("pineapple", "๐Ÿ"), + ("sweet_potato", "๐Ÿ "), + ("eggplant", "๐Ÿ†"), + ("tomato", "๐Ÿ…"), + ("corn", "๐ŸŒฝ"), + // Places + ("house", "๐Ÿ "), + ("house_with_garden", "๐Ÿก"), + ("school", "๐Ÿซ"), + ("office", "๐Ÿข"), + ("post_office", "๐Ÿฃ"), + ("hospital", "๐Ÿฅ"), + ("bank", "๐Ÿฆ"), + ("convenience_store", "๐Ÿช"), + ("love_hotel", "๐Ÿฉ"), + ("hotel", "๐Ÿจ"), + ("wedding", "๐Ÿ’’"), + ("church", "โ›ช"), + ("department_store", "๐Ÿฌ"), + ("european_post_office", "๐Ÿค"), + ("city_sunrise", "๐ŸŒ‡"), + ("city_sunset", "๐ŸŒ†"), + ("japanese_castle", "๐Ÿฏ"), + ("european_castle", "๐Ÿฐ"), + ("tent", "โ›บ"), + ("factory", "๐Ÿญ"), + ("tokyo_tower", "๐Ÿ—ผ"), + ("japan", "๐Ÿ—พ"), + ("mount_fuji", "๐Ÿ—ป"), + ("sunrise_over_mountains", "๐ŸŒ„"), + ("sunrise", "๐ŸŒ…"), + ("stars", "๐ŸŒ "), + ("statue_of_liberty", "๐Ÿ—ฝ"), + ("bridge_at_night", "๐ŸŒ‰"), + ("carousel_horse", "๐ŸŽ "), + ("rainbow", "๐ŸŒˆ"), + ("ferris_wheel", "๐ŸŽก"), + ("fountain", "โ›ฒ"), + ("roller_coaster", "๐ŸŽข"), + ("ship", "๐Ÿšข"), + ("speedboat", "๐Ÿšค"), + ("boat", "โ›ต"), + ("sailboat", "โ›ต"), + ("rowboat", "๐Ÿšฃ"), + ("anchor", "โš“"), + ("rocket", "๐Ÿš€"), + ("airplane", "โœˆ๏ธ"), + ("helicopter", "๐Ÿš"), + ("steam_locomotive", "๐Ÿš‚"), + ("tram", "๐Ÿš‹"), + ("mountain_railway", "๐Ÿšž"), + ("bike", "๐Ÿšฒ"), + ("aerial_tramway", "๐Ÿšก"), + ("suspension_railway", "๐ŸšŸ"), + ("mountain_cableway", "๐Ÿš "), + ("tractor", "๐Ÿšœ"), + ("blue_car", "๐Ÿš™"), + ("oncoming_automobile", "๐Ÿš˜"), + ("car", "๐Ÿš—"), + ("red_car", "๐Ÿš—"), + ("taxi", "๐Ÿš•"), + ("oncoming_taxi", "๐Ÿš–"), + ("articulated_lorry", "๐Ÿš›"), + ("bus", "๐ŸšŒ"), + ("oncoming_bus", "๐Ÿš"), + ("rotating_light", "๐Ÿšจ"), + ("police_car", "๐Ÿš“"), + ("oncoming_police_car", "๐Ÿš”"), + ("fire_engine", "๐Ÿš’"), + ("ambulance", "๐Ÿš‘"), + ("minibus", "๐Ÿš"), + ("truck", "๐Ÿšš"), + ("train", "๐Ÿš†"), + ("station", "๐Ÿš‰"), + ("train2", "๐Ÿš„"), + ("bullettrain_front", "๐Ÿš…"), + ("bullettrain_side", "๐Ÿš„"), + ("light_rail", "๐Ÿšˆ"), + ("monorail", "๐Ÿš"), + ("railway_car", "๐Ÿšƒ"), + ("trolleybus", "๐ŸšŽ"), + ("ticket", "๐ŸŽซ"), + ("fuelpump", "โ›ฝ"), + ("vertical_traffic_light", "๐Ÿšฆ"), + ("traffic_light", "๐Ÿšฅ"), + ("warning", "โš ๏ธ"), + ("construction", "๐Ÿšง"), + ("beginner", "๐Ÿ”ฐ"), + ("atm", "๐Ÿง"), + ("slot_machine", "๐ŸŽฐ"), + ("busstop", "๐Ÿš"), + ("barber", "๐Ÿ’ˆ"), + ("hotsprings", "โ™จ๏ธ"), + ("checkered_flag", "๐Ÿ"), + ("crossed_flags", "๐ŸŽŒ"), + ("izakaya_lantern", "๐Ÿฎ"), + ("moyai", "๐Ÿ—ฟ"), + ("circus_tent", "๐ŸŽช"), + ("performing_arts", "๐ŸŽญ"), + ("round_pushpin", "๐Ÿ“"), + ("triangular_flag_on_post", "๐Ÿšฉ"), + ("jp", "๐Ÿ‡ฏ๐Ÿ‡ต"), + ("kr", "๐Ÿ‡ฐ๐Ÿ‡ท"), + ("cn", "๐Ÿ‡จ๐Ÿ‡ณ"), + ("us", "๐Ÿ‡บ๐Ÿ‡ธ"), + ("fr", "๐Ÿ‡ซ๐Ÿ‡ท"), + ("es", "๐Ÿ‡ช๐Ÿ‡ธ"), + ("it", "๐Ÿ‡ฎ๐Ÿ‡น"), + ("ru", "๐Ÿ‡ท๐Ÿ‡บ"), + ("gb", "๐Ÿ‡ฌ๐Ÿ‡ง"), + ("uk", "๐Ÿ‡ฌ๐Ÿ‡ง"), + ("de", "๐Ÿ‡ฉ๐Ÿ‡ช"), + // Symbols + ("one", "1๏ธโƒฃ"), + ("two", "2๏ธโƒฃ"), + ("three", "3๏ธโƒฃ"), + ("four", "4๏ธโƒฃ"), + ("five", "5๏ธโƒฃ"), + ("six", "6๏ธโƒฃ"), + ("seven", "7๏ธโƒฃ"), + ("eight", "8๏ธโƒฃ"), + ("nine", "9๏ธโƒฃ"), + ("keycap_ten", "๐Ÿ”Ÿ"), + ("1234", "๐Ÿ”ข"), + ("zero", "0๏ธโƒฃ"), + ("hash", "#๏ธโƒฃ"), + ("symbols", "๐Ÿ”ฃ"), + ("arrow_backward", "โ—€๏ธ"), + ("arrow_down", "โฌ‡๏ธ"), + ("arrow_forward", "โ–ถ๏ธ"), + ("arrow_left", "โฌ…๏ธ"), + ("capital_abcd", "๐Ÿ” "), + ("abcd", "๐Ÿ”ก"), + ("abc", "๐Ÿ”ค"), + ("arrow_lower_left", "โ†™๏ธ"), + ("arrow_lower_right", "โ†˜๏ธ"), + ("arrow_right", "โžก๏ธ"), + ("arrow_up", "โฌ†๏ธ"), + ("arrow_upper_left", "โ†–๏ธ"), + ("arrow_upper_right", "โ†—๏ธ"), + ("arrow_double_down", "โฌ"), + ("arrow_double_up", "โซ"), + ("arrow_down_small", "๐Ÿ”ฝ"), + ("arrow_heading_down", "โ†˜๏ธ"), + ("arrow_heading_up", "โ†—๏ธ"), + ("leftwards_arrow_with_hook", "โ†ฉ๏ธ"), + ("arrow_right_hook", "โ†ช๏ธ"), + ("left_right_arrow", "โ†”๏ธ"), + ("arrow_up_down", "โ†•๏ธ"), + ("arrow_up_small", "๐Ÿ”ผ"), + ("arrows_clockwise", "๐Ÿ”ƒ"), + ("arrows_counterclockwise", "๐Ÿ”„"), + ("rewind", "โช"), + ("fast_forward", "โฉ"), + ("information_source", "โ„น๏ธ"), + ("ok", "๐Ÿ†—"), + ("twisted_rightwards_arrows", "๐Ÿ”€"), + ("repeat", "๐Ÿ”"), + ("repeat_one", "๐Ÿ”‚"), + ("new", "๐Ÿ†•"), + ("top", "๐Ÿ”"), + ("up", "๐Ÿ†™"), + ("cool", "๐Ÿ†’"), + ("free", "๐Ÿ†“"), + ("ng", "๐Ÿ†–"), + ("cinema", "๐ŸŽฆ"), + ("koko", "๐Ÿˆ"), + ("signal_strength", "๐Ÿ“ถ"), + ("u5272", "๐Ÿˆน"), + ("u5408", "๐Ÿˆด"), + ("u55b6", "๐Ÿˆบ"), + ("u6307", "๐Ÿˆฏ"), + ("u6708", "๐Ÿˆท๏ธ"), + ("u6709", "๐Ÿˆถ"), + ("u6e80", "๐Ÿˆต"), + ("u7121", "๐Ÿˆš"), + ("u7533", "๐Ÿˆธ"), + ("u7a7a", "๐Ÿˆณ"), + ("u7981", "๐Ÿˆฒ"), + ("sa", "๐Ÿˆ‚๏ธ"), + ("restroom", "๐Ÿšป"), + ("mens", "๐Ÿšน"), + ("womens", "๐Ÿšบ"), + ("baby_symbol", "๐Ÿšผ"), + ("no_smoking", "๐Ÿšญ"), + ("parking", "๐Ÿ…ฟ๏ธ"), + ("wheelchair", "โ™ฟ"), + ("metro", "๐Ÿš‡"), + ("baggage_claim", "๐Ÿ›„"), + ("accept", "๐Ÿ‰‘"), + ("wc", "๐Ÿšพ"), + ("potable_water", "๐Ÿšฐ"), + ("put_litter_in_its_place", "๐Ÿšฎ"), + ("secret", "ใŠ™๏ธ"), + ("congratulations", "ใŠ—๏ธ"), + ("m", "โ“‚๏ธ"), + ("passport_control", "๐Ÿ›‚"), + ("left_luggage", "๐Ÿ›…"), + ("customs", "๐Ÿ›ƒ"), + ("ideograph_advantage", "๐Ÿ‰"), + ("cl", "๐Ÿ†‘"), + ("sos", "๐Ÿ†˜"), + ("id", "๐Ÿ†”"), + ("no_entry_sign", "๐Ÿšซ"), + ("underage", "๐Ÿ”ž"), + ("no_mobile_phones", "๐Ÿ“ต"), + ("do_not_litter", "๐Ÿšฏ"), + ("non-potable_water", "๐Ÿšฑ"), + ("no_bicycles", "๐Ÿšณ"), + ("no_pedestrians", "๐Ÿšท"), + ("children_crossing", "๐Ÿšธ"), + ("no_entry", "โ›”"), + ("eight_spoked_asterisk", "โœณ๏ธ"), + ("eight_pointed_black_star", "โœด๏ธ"), + ("heart_decoration", "๐Ÿ’Ÿ"), + ("vs", "๐Ÿ†š"), + ("vibration_mode", "๐Ÿ“ณ"), + ("mobile_phone_off", "๐Ÿ“ด"), + ("chart", "๐Ÿ’น"), + ("currency_exchange", "๐Ÿ’ฑ"), + ("aries", "โ™ˆ"), + ("taurus", "โ™‰"), + ("gemini", "โ™Š"), + ("cancer", "โ™‹"), + ("leo", "โ™Œ"), + ("virgo", "โ™"), + ("libra", "โ™Ž"), + ("scorpius", "โ™"), + ("sagittarius", "โ™"), + ("capricorn", "โ™‘"), + ("aquarius", "โ™’"), + ("pisces", "โ™“"), + ("ophiuchus", "โ›Ž"), + ("six_pointed_star", "๐Ÿ”ฏ"), + ("negative_squared_cross_mark", "โŽ"), + ("a", "๐Ÿ…ฐ๏ธ"), + ("b", "๐Ÿ…ฑ๏ธ"), + ("ab", "๐Ÿ†Ž"), + ("o2", "๐Ÿ…พ๏ธ"), + ("diamond_shape_with_a_dot_inside", "๐Ÿ’ "), + ("recycle", "โ™ป๏ธ"), + ("end", "๐Ÿ”š"), + ("on", "๐Ÿ”›"), + ("soon", "๐Ÿ”œ"), + ("clock1", "๐Ÿ•"), + ("clock130", "๐Ÿ•œ"), + ("clock10", "๐Ÿ•™"), + ("clock1030", "๐Ÿ•ฅ"), + ("clock11", "๐Ÿ•š"), + ("clock1130", "๐Ÿ•ฆ"), + ("clock12", "๐Ÿ•›"), + ("clock1230", "๐Ÿ•ง"), + ("clock2", "๐Ÿ•‘"), + ("clock230", "๐Ÿ•"), + ("clock3", "๐Ÿ•’"), + ("clock330", "๐Ÿ•ž"), + ("clock4", "๐Ÿ•“"), + ("clock430", "๐Ÿ•Ÿ"), + ("clock5", "๐Ÿ•”"), + ("clock530", "๐Ÿ• "), + ("clock6", "๐Ÿ••"), + ("clock630", "๐Ÿ•ก"), + ("clock7", "๐Ÿ•–"), + ("clock730", "๐Ÿ•ข"), + ("clock8", "๐Ÿ•—"), + ("clock830", "๐Ÿ•ฃ"), + ("clock9", "๐Ÿ•˜"), + ("clock930", "๐Ÿ•ค"), + ("heavy_dollar_sign", "๐Ÿ’ฒ"), + ("copyright", "ยฉ๏ธ"), + ("registered", "ยฎ๏ธ"), + ("tm", "โ„ข๏ธ"), + ("x", "โŒ"), + ("heavy_exclamation_mark", "โ—"), + ("bangbang", "โ€ผ๏ธ"), + ("interrobang", "โ‰๏ธ"), + ("o", "โญ•"), + ("heavy_multiplication_x", "โœ–๏ธ"), + ("heavy_plus_sign", "โž•"), + ("heavy_minus_sign", "โž–"), + ("heavy_division_sign", "โž—"), + ("white_flower", "๐Ÿ’ฎ"), + ("100", "๐Ÿ’ฏ"), + ("heavy_check_mark", "โœ”๏ธ"), + ("ballot_box_with_check", "โ˜‘๏ธ"), + ("radio_button", "๐Ÿ”˜"), + ("link", "๐Ÿ”—"), + ("curly_loop", "โžฐ"), + ("wavy_dash", "ใ€ฐ๏ธ"), + ("part_alternation_mark", "ใ€ฝ๏ธ"), + ("trident", "๐Ÿ”ฑ"), + ("black_square", "โฌ›"), + ("white_square", "โฌœ"), + ("white_check_mark", "โœ…"), + ("black_square_button", "๐Ÿ”ฒ"), + ("white_square_button", "๐Ÿ”ณ"), + ("black_circle", "โšซ"), + ("white_circle", "โšช"), + ("red_circle", "๐Ÿ”ด"), + ("large_blue_circle", "๐Ÿ”ต"), + ("large_blue_diamond", "๐Ÿ”ท"), + ("large_orange_diamond", "๐Ÿ”ถ"), + ("small_blue_diamond", "๐Ÿ”น"), + ("small_orange_diamond", "๐Ÿ”ธ"), + ("small_red_triangle", "๐Ÿ”บ"), + ("small_red_triangle_down", "๐Ÿ”ป"), + ("shipit", "๐Ÿšข"), + ]) +}); + +pub fn replace_emoji(text: &str) -> String { + let mut result = String::with_capacity(text.len()); + let mut current = text; + + while let Some((before, after)) = current.split_once(':') { + result.push_str(before); + + if let Some((name, rest)) = after.split_once(':') { + if let Some(emoji) = EMOJIS.get(name) { + result.push_str(emoji); + } else { + result.push(':'); + result.push_str(name); + result.push(':'); + } + current = rest; + } else { + result.push(':'); + result.push_str(after); + current = ""; + break; + } + } + + if !current.is_empty() { + result.push_str(current); + } + + result +} diff --git a/src/markdown.rs b/src/markdown/mod.rs similarity index 96% rename from src/markdown.rs rename to src/markdown/mod.rs index 6926e4e..f700202 100644 --- a/src/markdown.rs +++ b/src/markdown/mod.rs @@ -6,7 +6,9 @@ use pulldown_cmark::{ use std::collections::HashMap; use std::fmt::Write; -// ========== ะšะปะฐัั ัะพัั‚ะพัะฝะธั ั‚ะฐะฑะปะธั†ั‹ ========== +mod emoji; +use emoji::replace_emoji; + #[derive(Debug, Clone, PartialEq)] pub enum AlignmentState { Left, @@ -219,12 +221,18 @@ impl MarkdownRenderer { let _ = write!(output, ""); } + Tag::Superscript => { + output.push_str(""); + } + + Tag::Subscript => { + output.push_str(""); + } + Tag::HtmlBlock | Tag::DefinitionList | Tag::DefinitionListTitle | Tag::DefinitionListDefinition - | Tag::Superscript - | Tag::Subscript | Tag::MetadataBlock(_) => (), } @@ -281,12 +289,18 @@ impl MarkdownRenderer { output.push_str(""); } + TagEnd::Superscript => { + output.push_str(""); + } + + TagEnd::Subscript => { + output.push_str(""); + } + TagEnd::HtmlBlock | TagEnd::DefinitionList | TagEnd::DefinitionListTitle | TagEnd::DefinitionListDefinition - | TagEnd::Superscript - | TagEnd::Subscript | TagEnd::MetadataBlock(_) => (), } @@ -303,6 +317,8 @@ pub fn markdown_to_html(markdown: &str, _file_path: &str) -> String { options.insert(Options::ENABLE_TASKLISTS); options.insert(Options::ENABLE_HEADING_ATTRIBUTES); options.insert(Options::ENABLE_GFM); + options.insert(Options::ENABLE_SUBSCRIPT); + options.insert(Options::ENABLE_SUPERSCRIPT); let mut renderer = MarkdownRenderer::new(); let mut html_output = String::new(); @@ -329,7 +345,7 @@ pub fn markdown_to_html(markdown: &str, _file_path: &str) -> String { if renderer.in_code_block { renderer.code_content.push_str(&text); } else { - html_output.push_str(&escape_html(&text)); + html_output.push_str(&escape_html(&replace_emoji(&text))); } } Event::TaskListMarker(true) => {