Expand description
Text formatting for emoji and markdown processing.
This module provides transformation of ASCII emoticons to Unicode emoji
and basic markdown formatting (bold, italic, code) with Ratatui styling.
ยงSupported ASCII Emoticons
The following ASCII emoticons are automatically converted to Unicode emoji:
| ASCII | Emoji | Description |
|---|---|---|
(y) | ๐ | Thumbs up |
:-) | ๐ | Smile |
:) | ๐ | Simple smile |
:-D | ๐ | Grin |
:D | ๐ | Grin |
;-) | ๐ | Wink |
;) | ๐ | Wink |
:-P | ๐ | Tongue |
:P | ๐ | Tongue |
:-( | ๐ | Sad |
:( | ๐ | Sad |
:/ | ๐ | Unsure |
:o | ๐ฎ | Surprised |
:O | ๐ฎ | Surprised |
:* | ๐ | Kiss |
:| | ๐ | Neutral |
:Q | ๐ถ | Baby face |
ยงMarkdown Formatting
*bold text*- Renders in bold_italic text_- Renders in italic`code`- Renders with code styling (reversed video)
Important: Content within backticks is treated as verbatim text. No emoji replacement, bold, or italic formatting will be applied inside backtick pairs. For example:
`*not bold*`- The asterisks remain literal`:) no emoji`- The emoticon remains as:)
Processing order ensures backticks are handled first, protecting their content from all subsequent transformations.
Enumsยง
- Segment ๐
- Text segment type after processing backticks
Constantsยง
- EMOJI_
MAP ๐ - Emoji replacement mappings (ASCII -> Unicode)
Functionsยง
- process_
backticks ๐ - Process backticks and return segments.
- process_
delimiter ๐ - Process a single delimiter pattern (like * or _) in text.
- process_
markdown ๐ - Process markdown formatting (bold and italic) in text.
- process_
text - Process text with emoji and markdown formatting.
- replace_
emoji ๐ - Replace ASCII emoticons with Unicode emoji.