Repository navigation
chore(mobile): upgrade gpt_markdown to 1.3.4 and migrate to new APIs - #8184
Open
saminsohag wants to merge 2 commits into
Open
saminsohag wants to merge 2 commits into
saminsohag wants to merge 2 commits into
Conversation
🔐 Codex Security Review
|
gpt_markdown renders a link's label by recursing with MarkdownScope.linkLabel. _ChannelLinkMd, _MentionMd, and CustomEmojiMd must not return WidgetSpans inside that label, because nested placeholders do not paint on iOS. Opt the three components out of the link-label scope and update the tests to find RichText subclasses rendered through BidiRichText. Fixes block#6124 Signed-off-by: Mohammad Asfour <masfour700@gmail.com>
Move mentions, channels and custom emoji from InlineMd/inlineComponents
to InlinePattern/inlinePatterns, and linkBuilder to inlineLinkBuilder.
This puts mobile on gpt_markdown's default parser.
Replace normalizeBareLinks with gpt_markdown's autolink
(autolinkSchemes: {'buzz'}), as the package docs recommend.
Fix what the new rendering exposed:
- the mention rewrite added a stray backtick when the count was odd
- a Buzz link chip merged its paragraph into one screen-reader stop
- height-bounded previews overflowed instead of clipping
Signed-off-by: Samin Yeasar Sohag <sssohag172@gmail.com>
saminsohag
force-pushed
the
chore/mobile-gpt-markdown-1.3.4
branch
from
October 8, 2026 19:12
02df67f to
2265793
Compare
This branch has not been deployed
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
Upgrades mobile's
gpt_markdownfrom 1.2.1 to 1.3.4 and moves off the APIs that 1.3 deprecates, so mobile renders through the package's default parser instead of the legacy regex pipeline.API migration
@mention,#channeland custom emoji move fromInlineMd+inlineComponentstoInlinePattern+inlinePatterns(InlinePattern.prefixedfor@/#). PassinginlineComponentsforced the whole widget onto the legacy parser.InlinePattern's default scopes already exclude link labels, so the explicitallScopesExceptLinkLabeloverrides from fix(mobile): keep token labels visible in authored Markdown links #7545 are no longer needed; the[#channel](url)/[@mention](url)/[:emoji:](url)regression tests still pass.linkBuilder→inlineLinkBuilder. Ordinary links are nowLinkTextSpans (they wrap across lines, sit on the baseline and are selectable); Buzz permalink chips and audio attachments stay widgets viaasWidgetSpan. Tap handling moved into_openLink, unchanged in behavior.Autolinking
Buzz's own
normalizeBareLinkspre-processor is removed in favor ofgpt_markdown's autolink withautolinkSchemes: {'buzz'}, as the package docs recommend. Visible differences:www.hosts and email addresses become links.buzz://URL of an unknown shape becomes an ordinary link (it does nothing when tapped), not a chip.Fixes the new rendering exposed
MessageContentre-added backticks around every odd segment, which adds one extra backtick when the count is odd (e.g. a 4-backtick fence closer). Previously hidden; with autolink the link swallowed it.MessageContentinto a max height; the new block layout reported aRenderFlexoverflow. They now lay the content out at its natural height and clip it.Related issue
Closes #8179.
Related:
Testing
just mobile-check— format and analyze clean, no deprecation warnings.just mobile-test— 3041 passed, 0 failed.just file-size-check— passes.message_content_autolink_test.dartports the deleted normalizer's cases (code-span boundaries, delimiters, punctuation, entity permalinks) to assertions on whatMessageContentactually renders.gives each inline pill its own screen-reader stoptest; verified it fails without the semantics fix.LinkTextSpan) instead ofTextwidgets.