feat(android): inline markdown rendering for messages (beta blocker 1/5)#594
Merged
Conversation
First of the five Android-beta daily-driver blockers from the milestone in roadmap.md: messages rendered as plain text. - domain/markdown/MarkdownParser.kt: pure, dependency-free inline parser → styled spans for **bold**, *italic*, ~~strike~~, `code`, ||spoiler||. Matches the desktop's inline subset. Unmatched delimiters stay literal (a stray * never eats the message). `_` is deliberately NOT an italic delimiter — intraword underscores (snake_case, __init__) are far more common in a dev/gaming chat than _italic_ and would false-positive. - ui/channel/MessageContent.kt: renders the spans to a Compose AnnotatedString; spoilers are background-filled + transparent until the message is tapped (click-to-reveal, matching desktop). - MessageItem wired to MessageContent. 13 JUnit tests for the parser (styles, nesting bold+italic, literal code/ spoiler content, unmatched/empty delimiters, ** beats *, underscores literal). No Android runtime needed for the parser tests; CI's Android Build + testDebugUnitTest validate compilation and tests (can't build Android locally). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First of the five Android-beta daily-driver blockers (
roadmap.mdAndroid milestone) — messages were rendered as plain text; they now render inline markdown.MarkdownParser.kt— pure, dependency-free inline parser → styled spans for**bold**,*italic*,~~strike~~,`code`,||spoiler||. Matches the desktop's inline subset. Robustness: unmatched delimiters stay literal (a stray*never eats the rest of a message); literal content inside code/spoiler isn't re-parsed._is not an italic delimiter. Intraword underscores (snake_case,__init__) are far more common in a dev/gaming chat than_italic_and would produce false italics —*italic*covers the need. (GFM-style word-boundary_can come later.)MessageContent.kt— renders the spans to a ComposeAnnotatedString; spoilers are background-filled + transparent until the message is tapped (click-to-reveal, matching desktop). Wired intoMessageItem.Tests
13 JUnit tests for the parser (each style, bold+italic nesting, literal code/spoiler content, unmatched/empty delimiters,
**beats*, underscores stay literal). The parser needs no Android runtime; CI's Android Build + testDebugUnitTest jobs validate compilation and tests (Android can't be built on the dev machine, same as vc-client).Part of the Android Beta milestone — 4 blockers remain (attachment display, unread indicators, DM UI, reaction picker).
🤖 Generated with Claude Code