Add irc_format module that removes mIRC control codes (bold, color, italic, underline, reverse, strikethrough, monospace, reset) before forwarding to Owncast. Color codes with fg/bg digit params are consumed correctly. Multi-byte UTF-8 (emoji, accented chars, CJK) is preserved. Made-with: Cursor
821 B
821 B
Strip IRC Formatting Codes from Owncast-bound Messages
Date: 2026-03-12
Task
IRC messages forwarded to Owncast contained mIRC formatting control codes (\x02, \x03, \x0F, etc.) that rendered as garbage glyphs since Owncast doesn't support any message styling.
Changes
- New file:
src/irc_format.rs—strip_formatting()function that removes all IRC formatting control codes: bold, color (with fg/bg digit parameters), reset, monospace, reverse, italic, strikethrough, and underline. Includes 18 unit tests. src/irc_task.rs— Callstrip_formatting()on the message body before constructing theBridgeEvent, so all downstream consumers see clean text.src/main.rs— Registered the newirc_formatmodule.
Follow-up
- None identified. No new dependencies added.