fix(chat): make URLs in markdown tables tappable - #231
Merged
Conversation
Table cells were rendered with plain Text, bypassing inline markdown parsing. As a result, URLs in tables were not clickable, unlike every other block type. Parse each header and cell with MarkdownLite.parseInline and render via InlineText so links open on tap.
Contributor
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s). |
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.
Problem
Markdown table cells were rendered with plain
Text, bypassing inline markdown parsing (parseInline). As a result, URLs in table cells were displayed as non-clickable plain text, unlike every other block type (paragraphs, headings, lists, blockquotes).Fix
Added a
RowScope.TableCellTextcomposable that parses each cell's content viaMarkdownLite.parseInline()and renders throughInlineText— the same component used by all other block types. This makes bare URLs, markdown links, inline code, bold, etc. all render and be tappable inside table cells.Headers and body cells now both use
TableCellText, with the header style preserving the existingSemiBoldweight.Changes
ChatMessageComponents.kt:RowScope.TableCellTexthelper (parses inline markdown + delegates toInlineTextwithweight(1f))Textcalls in theMarkdownBlock.Tablebranch withTableCellTextRowScopeimportNotes
parseInlineis cached per-cell viaremember(text)to avoid re-parsing on recompositionMarkdownBlock.Tablestill stores raw strings, parsing happens at render time (same pattern asLinkedText)