Repository navigation
Conversation
Parse each text message with the shared TextFormat parser and draw the display text with its spans: bold, italic, strike, code, quote bars and list indents. Masked links and mentions are remapped to display offsets; quote and list messages go to the text view path. Reply quotes, chat list previews, push bodies and Spotlight use the display text; Copy keeps the raw text. A masked link's target never becomes a link card. Mention detection allows one '_' before the '@' and trims a closing '_' that it opened, so _@jeff_ is an italic mention (spec rule 6).
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.
Stacked on #1035. Retarget to
mainafter #1035 merges.Text messages now go through the shared
TextFormatparser, and the bubble draws the display text with its spans.ChatTextFormatterparses a row and moves its detected links and mentions to display offsets.ChatMessage.formatcarries the raw text and the spans.ChatTextStylingapplies bold, italic, strike, code, quote and list indents toChatBubbleView.displayText. Code usesUIFont.roboto.LinkableBubbleView, which draws one bar per run of quoted lines. Bold, italic, strike and code stay on the label.NotificationPayload.decryptedBodyand Spotlight use the display text. Copy keeps the raw text._before the@and trims a closing_it opened (spec rule 6, mirroring feat(chat): render chat text formatting code-android-app#1748):_@jeff_is an italic mention,_@jeff__is@jeff_.DetectedLink.maskedLabelcarries a masked link's text, but tapping it still opens throughonOpenURL. Passing the label to the leaving-Flipcash warning is a follow-up once #1033 merges.