From aec46b3f2c77999da6dcc0a16d2d639cc02d8802 Mon Sep 17 00:00:00 2001 From: rainxchzed Date: Sat, 16 May 2026 19:58:23 +0500 Subject: [PATCH] feat(markdown): replace GitHub emoji shortcodes inline --- .../core/domain/util/EmojiShortcodes.kt | 387 ++++++++++++++++++ .../composeResources/files/whatsnew/18.json | 3 +- .../files/whatsnew/ar/18.json | 3 +- .../files/whatsnew/bn/18.json | 3 +- .../files/whatsnew/es/18.json | 3 +- .../files/whatsnew/fr/18.json | 3 +- .../files/whatsnew/hi/18.json | 3 +- .../files/whatsnew/it/18.json | 3 +- .../files/whatsnew/ja/18.json | 3 +- .../files/whatsnew/ko/18.json | 3 +- .../files/whatsnew/pl/18.json | 3 +- .../files/whatsnew/ru/18.json | 3 +- .../files/whatsnew/tr/18.json | 3 +- .../files/whatsnew/zh-CN/18.json | 3 +- .../details/data/utils/preprocessMarkdown.kt | 5 + 15 files changed, 418 insertions(+), 13 deletions(-) create mode 100644 core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/util/EmojiShortcodes.kt diff --git a/core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/util/EmojiShortcodes.kt b/core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/util/EmojiShortcodes.kt new file mode 100644 index 000000000..531472c50 --- /dev/null +++ b/core/domain/src/commonMain/kotlin/zed/rainxch/core/domain/util/EmojiShortcodes.kt @@ -0,0 +1,387 @@ +package zed.rainxch.core.domain.util + +object EmojiShortcodes { + // Subset of github/gemoji that covers the long tail of READMEs. + // ~250 entries — picked from gemoji download stats + common usage in + // README/CHANGELOG headers. Not exhaustive on purpose; missing + // shortcodes survive as literal text rather than ballooning the + // bundle with a 1500-entry table we mostly don't need. + private val TABLE: Map = + mapOf( + // Frequently used in README hero / status sections + "rocket" to "🚀", + "sparkles" to "✨", + "tada" to "🎉", + "fire" to "🔥", + "star" to "⭐", + "star2" to "🌟", + "boom" to "💥", + "zap" to "⚡", + "muscle" to "💪", + "raised_hands" to "🙌", + "tophat" to "🎩", + "crown" to "👑", + "trophy" to "🏆", + "medal" to "🎖️", + "100" to "💯", + "ok_hand" to "👌", + "pray" to "🙏", + "thumbsup" to "👍", + "+1" to "👍", + "thumbsdown" to "👎", + "-1" to "👎", + "clap" to "👏", + "wave" to "👋", + "point_right" to "👉", + "point_left" to "👈", + "point_up" to "☝️", + "point_down" to "👇", + // Status / signals + "warning" to "⚠️", + "white_check_mark" to "✅", + "heavy_check_mark" to "✔️", + "ballot_box_with_check" to "☑️", + "x" to "❌", + "negative_squared_cross_mark" to "❎", + "heavy_multiplication_x" to "✖️", + "no_entry" to "⛔", + "no_entry_sign" to "🚫", + "exclamation" to "❗", + "heavy_exclamation_mark" to "❗", + "bangbang" to "‼️", + "interrobang" to "⁉️", + "question" to "❓", + "grey_question" to "❔", + "grey_exclamation" to "❕", + "information_source" to "ℹ️", + // Hearts + "heart" to "❤️", + "yellow_heart" to "💛", + "green_heart" to "💚", + "blue_heart" to "💙", + "purple_heart" to "💜", + "black_heart" to "🖤", + "white_heart" to "🤍", + "orange_heart" to "🧡", + "brown_heart" to "🤎", + "broken_heart" to "💔", + "heart_eyes" to "😍", + "hearts" to "♥️", + // Faces + "smile" to "😄", + "smiley" to "😃", + "grin" to "😁", + "laughing" to "😆", + "joy" to "😂", + "wink" to "😉", + "blush" to "😊", + "innocent" to "😇", + "sunglasses" to "😎", + "thinking" to "🤔", + "raised_eyebrow" to "🤨", + "hugs" to "🤗", + "kissing_heart" to "😘", + "smirk" to "😏", + "rolling_eyes" to "🙄", + "neutral_face" to "😐", + "expressionless" to "😑", + "no_mouth" to "😶", + "face_with_monocle" to "🧐", + "nerd_face" to "🤓", + "exploding_head" to "🤯", + "cold_face" to "🥶", + "hot_face" to "🥵", + "partying_face" to "🥳", + "sob" to "😭", + "cry" to "😢", + "weary" to "😩", + "scream" to "😱", + "angry" to "😠", + "rage" to "😡", + "skull" to "💀", + "skull_and_crossbones" to "☠️", + "ghost" to "👻", + "alien" to "👽", + "robot" to "🤖", + "poop" to "💩", + "hankey" to "💩", + "shit" to "💩", + // Dev / engineer + "computer" to "💻", + "iphone" to "📱", + "watch" to "⌚", + "keyboard" to "⌨️", + "mouse_three_button" to "🖱️", + "printer" to "🖨️", + "minidisc" to "💽", + "floppy_disk" to "💾", + "cd" to "💿", + "dvd" to "📀", + "package" to "📦", + "outbox_tray" to "📤", + "inbox_tray" to "📥", + "envelope" to "✉️", + "email" to "📧", + "mailbox" to "📫", + "satellite" to "📡", + "tv" to "📺", + "camera" to "📷", + "camera_flash" to "📸", + "video_camera" to "📹", + "movie_camera" to "🎥", + "film_projector" to "📽️", + "telephone" to "☎️", + "phone" to "☎️", + "calling" to "📲", + "vibration_mode" to "📳", + "loud_sound" to "🔊", + "sound" to "🔉", + "speaker" to "🔈", + "mute" to "🔇", + "mega" to "📣", + "loudspeaker" to "📢", + // Tools / build + "hammer" to "🔨", + "wrench" to "🔧", + "screwdriver" to "🪛", + "nut_and_bolt" to "🔩", + "hammer_and_wrench" to "🛠️", + "toolbox" to "🧰", + "gear" to "⚙️", + "factory" to "🏭", + "construction" to "🚧", + "test_tube" to "🧪", + "petri_dish" to "🧫", + "dna" to "🧬", + "microscope" to "🔬", + "telescope" to "🔭", + "satellite_antenna" to "📡", + "magnet" to "🧲", + "balance_scale" to "⚖️", + "scales" to "⚖️", + // Symbols + "bug" to "🐛", + "ant" to "🐜", + "bulb" to "💡", + "lock" to "🔒", + "unlock" to "🔓", + "key" to "🔑", + "old_key" to "🗝️", + "shield" to "🛡️", + "scroll" to "📜", + "page_facing_up" to "📄", + "page_with_curl" to "📃", + "bookmark" to "🔖", + "bookmark_tabs" to "📑", + "books" to "📚", + "book" to "📖", + "notebook" to "📓", + "ledger" to "📒", + "memo" to "📝", + "pencil" to "📝", + "pencil2" to "✏️", + "black_nib" to "✒️", + "lower_left_fountain_pen" to "🖋️", + "lower_left_ballpoint_pen" to "🖊️", + "lower_left_paintbrush" to "🖌️", + "art" to "🎨", + "fireworks" to "🎆", + "balloon" to "🎈", + "gift" to "🎁", + "ribbon" to "🎀", + "confetti_ball" to "🎊", + "label" to "🏷️", + "round_pushpin" to "📍", + "pushpin" to "📌", + "paperclip" to "📎", + "link" to "🔗", + "chains" to "⛓️", + "triangular_flag_on_post" to "🚩", + "checkered_flag" to "🏁", + "rainbow" to "🌈", + "umbrella" to "☔", + "snowflake" to "❄️", + "snowman" to "⛄", + "sun_with_face" to "🌞", + "full_moon_with_face" to "🌝", + "earth_americas" to "🌎", + "earth_africa" to "🌍", + "earth_asia" to "🌏", + "globe_with_meridians" to "🌐", + // Animals frequently in READMEs + "octocat" to "🐙", + "cat" to "🐱", + "dog" to "🐶", + "rabbit" to "🐰", + "tiger" to "🐯", + "bear" to "🐻", + "panda_face" to "🐼", + "wolf" to "🐺", + "fox_face" to "🦊", + "unicorn" to "🦄", + "dragon" to "🐉", + "snake" to "🐍", + "whale" to "🐳", + "fish" to "🐟", + "penguin" to "🐧", + "owl" to "🦉", + "bird" to "🐦", + "chicken" to "🐔", + "duck" to "🦆", + "frog" to "🐸", + "monkey_face" to "🐵", + "monkey" to "🐒", + "see_no_evil" to "🙈", + "hear_no_evil" to "🙉", + "speak_no_evil" to "🙊", + // Food / coffee + "coffee" to "☕", + "tea" to "🍵", + "beer" to "🍺", + "beers" to "🍻", + "cocktail" to "🍸", + "wine_glass" to "🍷", + "champagne" to "🍾", + "tropical_drink" to "🍹", + "cake" to "🍰", + "birthday" to "🎂", + "cookie" to "🍪", + "doughnut" to "🍩", + "candy" to "🍬", + "lollipop" to "🍭", + "chocolate_bar" to "🍫", + "pizza" to "🍕", + "hamburger" to "🍔", + "fries" to "🍟", + "hot_dog" to "🌭", + "taco" to "🌮", + "burrito" to "🌯", + "sushi" to "🍣", + "ramen" to "🍜", + "rice" to "🍚", + "spaghetti" to "🍝", + "bread" to "🍞", + "cheese" to "🧀", + "egg" to "🥚", + "bacon" to "🥓", + "salad" to "🥗", + "apple" to "🍎", + "green_apple" to "🍏", + "banana" to "🍌", + "lemon" to "🍋", + "grapes" to "🍇", + "watermelon" to "🍉", + "strawberry" to "🍓", + "cherries" to "🍒", + "peach" to "🍑", + "pineapple" to "🍍", + "coconut" to "🥥", + "avocado" to "🥑", + "kiwi_fruit" to "🥝", + "carrot" to "🥕", + "corn" to "🌽", + "tomato" to "🍅", + "potato" to "🥔", + "hot_pepper" to "🌶️", + "mushroom" to "🍄", + "shamrock" to "☘️", + "leaves" to "🍃", + "fallen_leaf" to "🍂", + "maple_leaf" to "🍁", + "herb" to "🌿", + "evergreen_tree" to "🌲", + "deciduous_tree" to "🌳", + "palm_tree" to "🌴", + "cactus" to "🌵", + "tulip" to "🌷", + "sunflower" to "🌻", + "rose" to "🌹", + "wilted_flower" to "🥀", + "bouquet" to "💐", + "cherry_blossom" to "🌸", + // Travel / weather + "airplane" to "✈️", + "rocket_ship" to "🚀", + "car" to "🚗", + "taxi" to "🚕", + "bus" to "🚌", + "train" to "🚂", + "bike" to "🚲", + "house" to "🏠", + "house_with_garden" to "🏡", + "office" to "🏢", + "school" to "🏫", + "hospital" to "🏥", + "bank" to "🏦", + "atm" to "🏧", + "hotel" to "🏨", + "convenience_store" to "🏪", + "department_store" to "🏬", + "japanese_castle" to "🏯", + "european_castle" to "🏰", + "mountain" to "⛰️", + "volcano" to "🌋", + "sunny" to "☀️", + "cloud" to "☁️", + "partly_sunny" to "⛅", + "umbrella_with_rain_drops" to "☔", + "thunder_cloud_and_rain" to "⛈️", + "lightning" to "🌩️", + "tornado" to "🌪️", + ) + + // [a-z0-9_+\-] is a superset of github shortcode chars. The + // bookend `:` markers must be tight against the token (no spaces), + // and the shortcode itself must not embed `:` (so URL like + // `https://example.com:8080` doesn't grab `8080` as a code). + private val PATTERN = Regex(""":([a-z0-9_+\-]{1,40}):""") + + fun render(input: String): String { + if (input.isEmpty()) return input + if (!input.contains(':')) return input + return splitOutCodeRegions(input).joinToString("") { (chunk, isCode) -> + if (isCode) chunk else replaceInText(chunk) + } + } + + private fun replaceInText(text: String): String = + PATTERN.replace(text) { match -> + val key = match.groupValues[1] + TABLE[key] ?: match.value + } + + // Split the markdown body into alternating (text, code) regions + // anchored on triple-backtick fences. Single-backtick inline code + // is left in the text regions on purpose — losing rare emoji + // collisions in inline code is fine; properly tokenising inline + // spans isn't worth the parser complexity. + private data class Chunk(val content: String, val isCode: Boolean) + + private fun splitOutCodeRegions(input: String): List { + val fence = "```" + if (!input.contains(fence)) return listOf(Chunk(input, isCode = false)) + val out = mutableListOf() + var i = 0 + var inCode = false + while (i < input.length) { + val next = input.indexOf(fence, startIndex = i) + if (next < 0) { + out += Chunk(input.substring(i), isCode = inCode) + break + } + // Take everything up to and including the fence into the + // current region — the fence itself is part of the code + // block when we're transitioning out, so always include + // 3 chars in the "code" side. + if (inCode) { + out += Chunk(input.substring(i, next + fence.length), isCode = true) + } else { + out += Chunk(input.substring(i, next), isCode = false) + out += Chunk(fence, isCode = true) + } + i = next + fence.length + inCode = !inCode + } + return out + } +} diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/18.json index 4cf26a321..11f2dc565 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/18.json @@ -30,7 +30,8 @@ "bullets": [ "Manually linking apps — sorted by installer source (F-Droid / Obtainium first, Play Store and system updates last) with a chip showing each app's source.", "Manual link now suggests matching GitHub repos automatically — pick an app, get ranked candidates, tap to link. Manual URL entry still available.", - "GitHub-style alert callouts in README and release notes — Note, Tip, Important, Warning, Caution now render as tinted cards with icons instead of literal text." + "GitHub-style alert callouts in README and release notes — Note, Tip, Important, Warning, Caution now render as tinted cards with icons instead of literal text.", + "Emoji shortcodes in README and release notes — :rocket: now renders as 🚀, :tada: as 🎉, and ~250 others. Common dev/status icons covered out of the box." ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/ar/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/ar/18.json index 73db84ac7..20184799b 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/ar/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/ar/18.json @@ -30,7 +30,8 @@ "bullets": [ "عند الربط اليدوي للتطبيقات — يتم الفرز حسب مصدر التثبيت (F-Droid / Obtainium أولاً، Play Store وتحديثات النظام أخيراً) مع شارة تُظهر مصدر كل تطبيق.", "الربط اليدوي يقترح الآن مستودعات GitHub المطابقة تلقائياً — اختر تطبيقاً، احصل على مرشحين مرتبين، انقر للربط. الإدخال اليدوي للعنوان لا يزال متاحاً.", - "تنبيهات GitHub في README وملاحظات الإصدار — Note وTip وImportant وWarning وCaution تظهر الآن كبطاقات ملونة مع أيقونات بدلاً من نص حرفي." + "تنبيهات GitHub في README وملاحظات الإصدار — Note وTip وImportant وWarning وCaution تظهر الآن كبطاقات ملونة مع أيقونات بدلاً من نص حرفي.", + "اختصارات الإيموجي في README وملاحظات الإصدار — :rocket: تظهر الآن كـ 🚀، :tada: كـ 🎉، و~250 اختصاراً آخر." ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/bn/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/bn/18.json index 766382fc5..b4c301faa 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/bn/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/bn/18.json @@ -30,7 +30,8 @@ "bullets": [ "ম্যানুয়াল লিঙ্কে — ইনস্টলার উৎস অনুযায়ী সাজানো (F-Droid / Obtainium প্রথমে, Play Store ও সিস্টেম আপডেট শেষে), প্রতিটি অ্যাপের উৎস দেখাতে চিপ যুক্ত।", "ম্যানুয়াল লিঙ্ক এখন স্বয়ংক্রিয়ভাবে মিলে যাওয়া GitHub রিপো সাজেস্ট করে — অ্যাপ বেছে নিন, র‍্যাংকড প্রার্থী পান, লিঙ্ক করতে ট্যাপ করুন। ম্যানুয়াল URL এন্ট্রি এখনও উপলব্ধ।", - "README ও রিলিজ নোটে GitHub-স্টাইল অ্যালার্ট কলআউট — Note, Tip, Important, Warning, Caution এখন আইকনসহ রঙিন কার্ড হিসেবে দেখায়, আগে শুধু টেক্সট ছিল।" + "README ও রিলিজ নোটে GitHub-স্টাইল অ্যালার্ট কলআউট — Note, Tip, Important, Warning, Caution এখন আইকনসহ রঙিন কার্ড হিসেবে দেখায়, আগে শুধু টেক্সট ছিল।", + "README ও রিলিজ নোটে ইমোজি শর্টকোড — :rocket: এখন 🚀, :tada: এখন 🎉, এবং আরও ~250টি।" ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/es/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/es/18.json index 115ddcd79..22ddbec88 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/es/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/es/18.json @@ -30,7 +30,8 @@ "bullets": [ "Al vincular apps manualmente — orden por origen del instalador (F-Droid / Obtainium primero, Play Store y actualizaciones del sistema al final) con un chip que muestra el origen de cada app.", "El enlace manual ahora sugiere repos de GitHub coincidentes automáticamente — elige una app, obtén candidatos clasificados, toca para vincular. Sigue disponible la entrada manual de URL.", - "Llamadas de alerta estilo GitHub en README y notas de versión — Note, Tip, Important, Warning, Caution se muestran como tarjetas tintadas con iconos en vez de texto literal." + "Llamadas de alerta estilo GitHub en README y notas de versión — Note, Tip, Important, Warning, Caution se muestran como tarjetas tintadas con iconos en vez de texto literal.", + "Atajos de emoji en README y notas de versión — :rocket: ahora se ve como 🚀, :tada: como 🎉, y ~250 más." ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/fr/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/fr/18.json index a6bdaefa9..df9f5575b 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/fr/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/fr/18.json @@ -30,7 +30,8 @@ "bullets": [ "Lors du lien manuel — tri par source d'installation (F-Droid / Obtainium d'abord, Play Store et mises à jour système en dernier) avec une puce indiquant la source de chaque app.", "Le lien manuel suggère désormais automatiquement les dépôts GitHub correspondants — choisis une app, obtiens des candidats classés, touche pour lier. Saisie d'URL manuelle toujours disponible.", - "Encadrés d'alerte style GitHub dans README et notes de version — Note, Tip, Important, Warning, Caution s'affichent en cartes teintées avec icônes plutôt qu'en texte brut." + "Encadrés d'alerte style GitHub dans README et notes de version — Note, Tip, Important, Warning, Caution s'affichent en cartes teintées avec icônes plutôt qu'en texte brut.", + "Raccourcis emoji dans README et notes de version — :rocket: s'affiche en 🚀, :tada: en 🎉, et ~250 autres." ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/hi/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/hi/18.json index a61703b52..c1025a48b 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/hi/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/hi/18.json @@ -30,7 +30,8 @@ "bullets": [ "मैन्युअल लिंक में — इंस्टॉलर स्रोत के अनुसार क्रम (F-Droid / Obtainium पहले, Play Store और सिस्टम अपडेट अंत में), हर ऐप के स्रोत को दिखाने वाली चिप के साथ।", "मैन्युअल लिंक अब अपने आप मेल खाते GitHub रिपो सुझाता है — कोई ऐप चुनें, रैंक किए हुए उम्मीदवार पाएं, लिंक करने के लिए टैप करें। मैन्युअल URL एंट्री अब भी उपलब्ध है।", - "README और रिलीज़ नोट्स में GitHub-शैली अलर्ट कॉलआउट — Note, Tip, Important, Warning, Caution अब आइकन के साथ रंगीन कार्ड के रूप में दिखेंगे, पहले सिर्फ टेक्स्ट थे।" + "README और रिलीज़ नोट्स में GitHub-शैली अलर्ट कॉलआउट — Note, Tip, Important, Warning, Caution अब आइकन के साथ रंगीन कार्ड के रूप में दिखेंगे, पहले सिर्फ टेक्स्ट थे।", + "README और रिलीज़ नोट्स में इमोजी शॉर्टकोड — :rocket: अब 🚀 दिखेगा, :tada: 🎉, और ~250 अन्य।" ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/it/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/it/18.json index 30ef51f3b..b5d35cfe4 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/it/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/it/18.json @@ -30,7 +30,8 @@ "bullets": [ "Collegamento manuale di app — ordinate per origine di installazione (F-Droid / Obtainium per primi, Play Store e aggiornamenti di sistema per ultimi) con un chip che mostra l'origine di ogni app.", "Il collegamento manuale ora suggerisce automaticamente repo GitHub corrispondenti — scegli un'app, ottieni candidati classificati, tocca per collegare. L'inserimento manuale dell'URL resta disponibile.", - "Avvisi stile GitHub in README e note di rilascio — Note, Tip, Important, Warning, Caution ora si vedono come card colorate con icone invece di testo letterale." + "Avvisi stile GitHub in README e note di rilascio — Note, Tip, Important, Warning, Caution ora si vedono come card colorate con icone invece di testo letterale.", + "Codici emoji in README e note di rilascio — :rocket: ora appare come 🚀, :tada: come 🎉, e ~250 altri." ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/ja/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/ja/18.json index e0fde1be9..48d5a43f1 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/ja/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/ja/18.json @@ -30,7 +30,8 @@ "bullets": [ "手動リンク — インストーラ別に並び替え(F-Droid / Obtainium が先、Play ストアやシステム更新は最後)し、各アプリの入手元をチップで表示。", "手動リンクが一致する GitHub リポを自動提案 — アプリを選ぶとランク付き候補が出る。タップでリンク。手動 URL 入力も引き続き利用可能。", - "README やリリースノートで GitHub スタイルのアラートが表示されるように — Note、Tip、Important、Warning、Caution がアイコン付きの色付きカードでレンダリングされます。" + "README やリリースノートで GitHub スタイルのアラートが表示されるように — Note、Tip、Important、Warning、Caution がアイコン付きの色付きカードでレンダリングされます。", + "README とリリースノートで絵文字ショートコードに対応 — :rocket: は 🚀、:tada: は 🎉、合計約 250 種類。" ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/ko/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/ko/18.json index 44172b701..a15b93755 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/ko/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/ko/18.json @@ -30,7 +30,8 @@ "bullets": [ "수동 연결 — 설치 출처별 정렬(F-Droid / Obtainium 먼저, Play 스토어와 시스템 업데이트는 마지막)에 각 앱의 출처를 보여주는 칩 표시.", "수동 연결이 일치하는 GitHub 리포를 자동으로 제안합니다 — 앱 선택 후 순위 후보를 받고 탭하여 연결. 수동 URL 입력도 그대로 사용 가능.", - "README와 릴리스 노트에서 GitHub 스타일 알림 카드 — Note, Tip, Important, Warning, Caution이 아이콘과 함께 색상 카드로 표시됩니다." + "README와 릴리스 노트에서 GitHub 스타일 알림 카드 — Note, Tip, Important, Warning, Caution이 아이콘과 함께 색상 카드로 표시됩니다.", + "README와 릴리스 노트에서 이모지 단축코드 지원 — :rocket: 은 🚀, :tada: 는 🎉, 총 약 250개." ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/pl/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/pl/18.json index 6fa939e4f..47d59719d 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/pl/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/pl/18.json @@ -30,7 +30,8 @@ "bullets": [ "Ręczne powiązywanie aplikacji — sortowane wg źródła instalatora (F-Droid / Obtainium na początku, Play Store i aktualizacje systemu na końcu) z chipem pokazującym źródło każdej aplikacji.", "Ręczne powiązanie automatycznie proponuje pasujące repozytoria GitHub — wybierz aplikację, otrzymaj uszeregowanych kandydatów, dotknij, aby powiązać. Ręczne wpisanie URL nadal dostępne.", - "Wyróżnienia w stylu GitHub w README i notatkach wydania — Note, Tip, Important, Warning, Caution renderują się teraz jako kolorowe karty z ikonami zamiast surowego tekstu." + "Wyróżnienia w stylu GitHub w README i notatkach wydania — Note, Tip, Important, Warning, Caution renderują się teraz jako kolorowe karty z ikonami zamiast surowego tekstu.", + "Skróty emoji w README i notatkach wydania — :rocket: pokazuje się jako 🚀, :tada: jako 🎉, łącznie ~250 skrótów." ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/ru/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/ru/18.json index 30ef6eaec..4427f2833 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/ru/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/ru/18.json @@ -30,7 +30,8 @@ "bullets": [ "Ручная привязка приложений — сортировка по источнику установки (F-Droid / Obtainium первыми, Play Маркет и системные обновления — последними), с шильдиком источника для каждого приложения.", "Ручная привязка теперь автоматически предлагает подходящие GitHub-репозитории — выберите приложение, получите ранжированных кандидатов, нажмите для привязки. Ручной ввод URL по-прежнему доступен.", - "Выделения в стиле GitHub в README и заметках о выпуске — Note, Tip, Important, Warning, Caution теперь отображаются цветными карточками с иконками вместо обычного текста." + "Выделения в стиле GitHub в README и заметках о выпуске — Note, Tip, Important, Warning, Caution теперь отображаются цветными карточками с иконками вместо обычного текста.", + "Короткие коды эмодзи в README и заметках о выпуске — :rocket: теперь 🚀, :tada: — 🎉, всего около 250 кодов." ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/tr/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/tr/18.json index 01ad752d5..35900c2be 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/tr/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/tr/18.json @@ -30,7 +30,8 @@ "bullets": [ "Uygulamayı manuel bağlarken — yükleyici kaynağına göre sıralı (önce F-Droid / Obtainium, en sonda Play Store ve sistem güncellemeleri); her uygulamanın kaynağını gösteren çip eklendi.", "Manuel bağlama artık eşleşen GitHub depolarını otomatik öneriyor — uygulamayı seçin, sıralı adaylar alın, bağlamak için dokunun. URL'yi manuel girme seçeneği de duruyor.", - "README ve sürüm notlarında GitHub tarzı uyarı kutuları — Note, Tip, Important, Warning, Caution artık düz metin yerine ikonlu renkli kartlar olarak görünüyor." + "README ve sürüm notlarında GitHub tarzı uyarı kutuları — Note, Tip, Important, Warning, Caution artık düz metin yerine ikonlu renkli kartlar olarak görünüyor.", + "README ve sürüm notlarında emoji kısayolları — :rocket: artık 🚀 olarak, :tada: 🎉 olarak ve ~250 başka kısayol." ] } ] diff --git a/core/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/18.json b/core/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/18.json index f11e145db..5d52f23e9 100644 --- a/core/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/18.json +++ b/core/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/18.json @@ -30,7 +30,8 @@ "bullets": [ "手动链接应用时 — 按安装来源排序(F-Droid / Obtainium 在前,Play 商店与系统更新在后),并通过标签显示每个应用的来源。", "手动链接现可自动推荐匹配的 GitHub 仓库 — 选择应用,获得排序后的候选项,点击即可链接。仍支持手动输入 URL。", - "README 与发布说明中的 GitHub 风格警示框 — Note、Tip、Important、Warning、Caution 现在以带图标的彩色卡片呈现,而不是字面文本。" + "README 与发布说明中的 GitHub 风格警示框 — Note、Tip、Important、Warning、Caution 现在以带图标的彩色卡片呈现,而不是字面文本。", + "README 与发布说明中的 emoji 简写 — :rocket: 现在显示为 🚀,:tada: 为 🎉,共约 250 种。" ] } ] diff --git a/feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/utils/preprocessMarkdown.kt b/feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/utils/preprocessMarkdown.kt index ba668834c..fc11eed7b 100644 --- a/feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/utils/preprocessMarkdown.kt +++ b/feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/utils/preprocessMarkdown.kt @@ -481,5 +481,10 @@ fun preprocessMarkdown( "", ) + // 15. Replace GitHub emoji shortcodes (:rocket: → 🚀). Skips fenced + // code blocks; inline `:foo:` patterns inside `` `code` `` are + // rare enough not to warrant deeper tokenisation. + processed = zed.rainxch.core.domain.util.EmojiShortcodes.render(processed) + return processed.trim() }