Skip to content

fix(ui): preserve parenthesized tildes in markdown - #12540

Merged
johnnyeric merged 2 commits into
Kilo-Org:mainfrom
Githubguy132010:codex/fix-markdown-strikethrough-parsing
Jul 27, 2026
Merged

fix(ui): preserve parenthesized tildes in markdown#12540
johnnyeric merged 2 commits into
Kilo-Org:mainfrom
Githubguy132010:codex/fix-markdown-strikethrough-parsing

Conversation

@Githubguy132010

@Githubguy132010 Githubguy132010 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Issue

Fixes #12530

Context

Marked treats a tilde immediately preceded by ( as a closing strikethrough delimiter. As a result, ordinary expressions such as (~24 GB) and (~5.7 GB) can form an unintended strikethrough span in rendered chat messages.

Implementation

Reject the invalid closing delimiter at the existing Marked tokenizer boundary while preserving valid single- and double-tilde strikethrough syntax. Regression coverage includes the minimal issue reproduction, the reported size example, tilde paths, and valid strikethrough forms.

Screenshots / Video

Before:

image

After:

Scherm­afbeelding 2026-07-26 om 16 30 04

How to Test

Manual/local verification

  • Agent ran the full @opencode-ai/ui test suite: 90 passed, 0 failed.
  • Agent ran the UI package typecheck, repository lint, Prettier check, annotation guard, markdown-table guard, and git diff --check; all passed.
  • The pre-push hook ran the cross-package typecheck successfully.

Reviewer test steps

  1. Render (~a (~b or (~24 GB) and (~5.7 GB) in a chat message.
  2. Confirm the text remains literal and contains no strikethrough.
  3. Render ~removed~, ~~removed~~, and (~removed~).
  4. Confirm valid strikethrough syntax still renders with a line through removed.

Blocked checks and substitute verification

  • None. All relevant checks completed successfully.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

thomas07374

@Githubguy132010
Githubguy132010 marked this pull request as ready for review July 26, 2026 14:36
@johnnyeric
johnnyeric merged commit 2da8949 into Kilo-Org:main Jul 27, 2026
28 checks passed
@johnnyeric

Copy link
Copy Markdown
Contributor

Thanks for the fix! Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Markdown renderer misparses (~ as strikethrough opener

2 participants