Skip to content

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

Closed
ahalekelly wants to merge 1 commit into
pingdotgg:mainfrom
ahalekelly:fix/mobile-tilde-flanking
Closed

ahalekelly wants to merge 1 commit into
pingdotgg:mainfrom
ahalekelly:fix/mobile-tilde-flanking

Conversation

@ahalekelly

Copy link
Copy Markdown
Contributor

🤖 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:

Input Web Mobile today
~$0.48 vs ~$0.65 per run literal strikes $0.48 vs
files in ~/foo and ~/bar literal strikes /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:

Input Web Mobile before Mobile after
~$0.48 vs ~$0.65 per run literal strikes literal
files in ~/foo and ~/bar literal strikes literal
~~ not ~~ literal strikes literal
~ ~ literal strikes literal
a~~b~~c strikes b literal strikes b
x~y~z strikes y literal strikes 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

…behavior

Mobile's md4c qualified tilde openers and closers by different rules than
web's micromark, so `~$0.48 vs ~$0.65` and `~/foo and ~/bar` rendered struck
through on mobile but not web. Apply emphasis-style flanking to tilde runs,
which is the rule micromark uses. This also aligns `~~` with web: intraword
`a~~b~~c` now strikes, and space-flanked `~~ b ~~` no longer does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 11, 2026

Copy link
Copy Markdown
Member

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.

@macroscopeapp

macroscopeapp Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

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.

@ahalekelly

ahalekelly commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 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:

Input GitHub and web Mobile
~$0.48 vs ~$0.65 per run plain strikes $0.48 vs
files in ~/foo and ~/bar plain strikes /foo and
~~ not ~~ plain strikes not
a~~b~~c strikes b plain

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Sent prompts strike through text between two single tildes that the rich composer showed literally

2 participants