[Bug]: Mobile renders single tildes (~) in numeric ranges as strikethrough
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/mobile
Steps to reproduce
- Open a thread in T3 Code Mobile (observed on Android).
- Have an agent reply with a paragraph containing two or more ordinary single tildes (
~) — very common in CJK/Chinese numeric ranges or home-relative paths, for example:每分钟稳定 370~418 次请求(约 6.5~7 QPS)平均每 3~6 分钟重启一次;同时单个进程内存涨到 1.3~1.5 GB,CPU 拉到 170%~190%。
- Inspect the rendered reply in the mobile timeline.
Expected behavior
Single ~ characters in prose (e.g. 370~418, 6.5~7, 3~6, 1.3~1.5, ~/a ... ~/b) should render literally without strikethrough, while explicit double-tilde ~~strikethrough~~ continues to render as strikethrough.
Actual behavior
Pairs of single ~ within the same paragraph are parsed as GFM strikethrough delimiters: both ~ characters are stripped and everything between them is crossed out, corrupting the numbers:
370~418 次请求(约 6.5~7 QPS)renders as370+ ~~418 次请求(约 6.5~~ +7 QPS)(visually370418and6.57).每 3~6 分钟……涨到 1.3~1.5 GBrenders as每 3+ ~~6 分钟……涨到 1.3~~ +1.5 GB(visually36and1.31.5), while an odd trailing third170%~190%stays literal.
Root cause in apps/mobile
This is the mobile counterpart of #29254 (and #16105 for user prompts). Open PR #29270 only targets apps/web / packages/shared and does not touch apps/mobile:
apps/mobile/src/lib/markdownDocument.ts(lines 14 and 491) configuresunified().use(remarkParse).use(remarkGfm)without{ singleTilde: false }.- Mobile renders chat Markdown through
apps/mobile/src/native/EnrichedMarkdownText.tsx(react-native-enriched-markdown), whose native Markdown parser also treats single~...~as strikethrough unless single tildes are escaped duringmarkdownForNativeRendering(outside code spans/fences) or disabled in the native parser config.
Related
- #29254 (same single-tilde strikethrough bug on desktop/web; PR #29270 does not cover
apps/mobile) - #16105 (single-tilde strikethrough in user prompts, fixed for web via
[remarkGfm, { singleTilde: false }]inpackages/shared/src/markdownPipeline.ts)
Impact
Minor bug or occasional failure
Version or commit
T3 Code Mobile (Android) / main
Environment
Android, T3 Code Mobile (react-native-enriched-markdown 1.2.0-t3.18)
Logs or stack traces
Raw assistant Markdown stored in thread:
1. **每分钟稳定 370~418 次请求(约 6.5~7 QPS)**
2. 平均每 3~6 分钟重启一次;同时单个进程内存涨到 1.3~1.5 GB,CPU 拉到 170%~190%。
Rendered on T3 Mobile (Android):
- "418 次请求(约 6.5" is struck through with both `~` removed ("370418", "6.57")
- "6 分钟……涨到 1.3" is struck through with both `~` removed ("36", "1.31.5")
Screenshots, recordings, or supporting files
No response
Workaround
Instruct agents to use - / – (en dash) instead of ~ for numeric ranges, or wrap ranges in inline code backticks.
This is the same problem as #29254, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.
This is distinct from #29254 on the implementation side and will not be resolved by #29254's current PR:
- Separate Markdown rendering stack on mobile: #29254 targets the desktop/web client (which has since moved off
remarktoWordsin #27866), whereas mobile renders through a completely separate pipeline:apps/mobile/src/lib/markdownDocument.ts(lines 14 & 491, usingremarkGfmwithout{ singleTilde: false }) andapps/mobile/src/native/EnrichedMarkdownText.tsx(react-native-enriched-markdown, whose native parser also treats single~...~as strikethrough). - Existing web PRs do not touch
apps/mobile:- Open PR #29270 (for #29254) modifies zero files under
apps/mobile. - Merged PR #35859 (for #16105, fixing single tildes in sent user prompts) also modified zero files under
apps/mobile, so mobile still lacks that already-approved fix as well.
- Open PR #29270 (for #29254) modifies zero files under
Because fixing #29254 / #29270 will still leave apps/mobile affected, please reopen this to track the apps/mobile pipeline separately (or explicitly include apps/mobile in the fix).