A tiny, cross-platform Scala 3 lookup that turns :shortcode: syntax into
the matching emoji glyph: :smile: β π. Works on JVM, Scala.js, and
Scala Native.
libraryDependencies += "io.github.edadma" %%% "emoji" % "0.1.2"import io.github.edadma.emoji.Emoji
Emoji(":smile:") // β "π"
Emoji("hello :smile: world :wave:") // β "hello π world π"
Emoji(":__not_a_real_one__:") // β ":__not_a_real_one__:" (passthrough)Emoji.apply walks the input once with a :[a-z_]+: regex and substitutes
each known shortcode for its Unicode codepoint (via
Character.toChars so non-BMP code points like :heart_eyes: (U+1F60D)
get the surrogate pair on the JVM).
Unknown shortcodes are left intact in the output.
The shortcode β codepoint map lives in Emoji.scala (auto-generated from
emoji.json at the repo root). It covers ~1,800 shortcodes drawn from the
GitHub / Slack flavour of emoji.
sbt emojiJVM/test
sbt emojiJS/test
sbt emojiNative/test