Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): stop striking through ~$ prices and ~/ paths, match web behavior #18156

Closedahalekelly(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/18156/headopened View on GitHub

🤖 Generated with Claude Code using Claude Opus 5.5

Problem

Mobile strikes through text that web renders as written. Cost estimates and home paths are common in agent output, and mobile strikes them:

InputWebMobile today
~$0.48 vs ~$0.65 per runliteralstrikes $0.48 vs
files in ~/foo and ~/barliteralstrikes /foo and

Change

Both mobile platforms parse chat markdown with the md4c copy inside react-native-nitro-markdown (iOS through t3-markdown-text, Android through nitro's <Markdown>). md4c decides whether a ~ can open or close a strikethrough with a looser rule than web's micromark (remark-gfm): micromark requires a closer to follow a non-space character, while md4c checks only the character after it, and punctuation like $ or / qualifies.

The md4c patch now classifies tilde runs with the flanking rule md4c already uses for * and _, which is the rule micromark uses for ~. $ math spans are unchanged. Web is unchanged, and single-tilde pairs still strike wherever web strikes them, such as ~$45B senior/~$30-35B junior.

Scope and approval

Fixes #16105, whose report is the false strikethroughs above. #9021 proposed double-tilde-only parsing on web and mobile, and the maintainer review asked for a decision between that and having mobile match web first. This PR is the narrower option: mobile matches web's existing rules, and no product behavior changes on web.

Verification

I compiled the vendored md4c before and after the patch into a standalone driver and compared both with micromark on 20 tilde inputs. All 20 now match web; before the patch, 6 differed:

InputWebMobile beforeMobile after
~$0.48 vs ~$0.65 per runliteralstrikesliteral
files in ~/foo and ~/barliteralstrikesliteral
~~ not ~~literalstrikesliteral
~ ~literalstrikesliteral
a~~b~~cstrikes bliteralstrikes b
x~y~zstrikes yliteralstrikes y

The other 14 inputs (including ~~struck~~, ~one~ and ~~two~~, (~a~), ~~mismatch~, and the ~$45B senior/~$30-35B junior example) matched before and still match. The last four rows above show that ~~ and intraword tildes now follow web's rules too.

Not checked: I did not build the app or capture device screenshots.

Claude Opus 5.5 via Claude Code in T3 Code

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Note

      This comment is posted by Julius' dot

      The parser comparison is useful, but this changes rendered mobile text and the PR explicitly says no app build or device screenshots were checked. Closing under the verification requirement. Add before/after screenshots from the mobile app showing the price and path examples, verify the native build, and request reconsideration. The maintainer direction question raised in #9021 also remains unresolved; please link confirmation of the mobile-only scope.

    3. juliusmarminge closed this

    4. Approvability

      Verdict: Approved at da5c053

      Macroscope's review found this PR approvable — This is a localized mobile markdown parsing fix that aligns tilde strikethrough handling with existing web behavior. The lockfile update only records the patched dependency hash, and the PR changes no product defaults or static-analysis settings.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. ahalekelly(GitHub profile, opens in a new tab)commented

      🤖 Generated with Claude Opus 5.5

      Following up on the close note, I'm trying to get this fixed upstream.

      Scope: this is a mobile-only bug fix with no product change. Mobile's md4c strikes tildes that web (remark-gfm) and GitHub both leave plain, and misses intraword strikes both render:

      InputGitHub and webMobile
      ~$0.48 vs ~$0.65 per runplainstrikes $0.48 vs
      files in ~/foo and ~/barplainstrikes /foo and
      ~~ not ~~plainstrikes not
      a~~b~~cstrikes bplain

      Route: the bug is md4c's flanking rule. mity/md4c#440 is reworking those rules, and I've suggested there that strikethrough use GitHub's asterisk-like rule (it passes md4c's full suite). Instead of the pnpm patch, I've opened software-mansion-labs/md4c#6 and pingdotgg/enriched-markdown#11; once #11 merges I'll reopen this as a tarball bump with simulator before/after screenshots and a native build.

Sign in to join this conversation.