Skip to content

v1.10.4: fix "~" striking text through in AI answers and EVAL.md - #15

Merged
gitluis merged 1 commit into
masterfrom
fix-tilde-strikethrough
Nov 2, 2026
Merged

gitluis merged 1 commit into
masterfrom
fix-tilde-strikethrough

Conversation

@gitluis

@gitluis gitluis commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Stacked on #14 (fix-ai-refusals) so the version numbers stay in order. The code doesn't depend on #13 or #14. Merge order: #13 (v1.10.2) → #14 (v1.10.3) → this (v1.10.4) → #10 (v1.11.0). When #14 merges, GitHub should retarget this PR to master; if it doesn't, retarget it (CLAUDE.md §0).

Summary

AI answers no longer show crossed-out text where Claude wrote "~" for "about". Found in Luis's screenshot of the AI tab on 2026-10-26; the bug was already on master.

Cause

renderMarkdown() uses marked in GFM mode, which treats text between two single tildes as strikethrough, not only ~~double~~. Claude often writes ~ to mean "about", so two approximations on one line can pair up:

Claude wrote Shown before this PR
~3-5% (~$150-245) 3-5% ($150-245)
~$470/mo, ~9.6% of income (~$516 … $470/mo, ~9.6% of income ($516 …

GitHub uses the same rule, so docs/EVAL.md had the same problem in its excerpts: 16 passages showed crossed out when viewed on GitHub.

What changed

  • js/core.js
    • A del tokenizer override next to renderMarkdown(): a single ~ is kept as text.
    • ~~double~~ still means strikethrough: for those, the override returns false, which hands them to marked's own rule.
    • Everywhere it applies: every renderMarkdown() caller (AI tab, AI Eval answers, Changelog view). Nothing else about the rendering or sanitizing changes.
  • js/views-eval.js
    • EVAL.md excerpt cells escape ~ as \~ (quote()), which GitHub shows as a plain tilde. Code spans still use pipe(), since \~ would show literally there.
  • docs/EVAL.md
    • Regenerated from the same eval-results.json. The only change is ~ → \~ in 115 excerpt lines; the numbers and the hand-written sections are unchanged.
    • Archived reports in docs/eval-runs/ are kept as published, so they still show the crossed-out passages on GitHub.
  • v1.10.4 in CHANGELOG, index.html, README and views-settings.js. CLAUDE.md §8, §13 (single ~ is literal) and §21 (excerpts escape ~).

How it was tested

Headless Chromium with the pinned marked 15.0.12 and DOMPurify 3.4.17, on 73e5b08.

Not verified: a real answer in your browser. That's the first check below.

Please check before merging

  • On this branch, open the AI tab and ask Where am I overspending? The benchmark column should read like ~3-5% (~$150-245), with nothing crossed out.
  • Open docs/EVAL.md on GitHub, in this PR's branch, and scroll through the excerpt tables: tildes show as "~", not crossed out.


Generated by Claude Code

Claude writes "~" to mean "about", but marked's GFM mode strikes
through text between two single tildes: "~3-5% (~$150-245)" showed
"3-5% (" crossed out in the AI tab (Luis's screenshot, 2026-10-26).
The bug was already on master.

- core.js: a del tokenizer override keeps a single ~ as text; ~~double~~
  is still strikethrough (marked's own rule). Applies to every
  renderMarkdown() caller: AI tab, AI Eval answers, Changelog view.
- views-eval.js: EVAL.md excerpt cells escape ~ (quote()), since
  GitHub has the same single-tilde rule; docs/EVAL.md regenerated from
  the same results, only ~ -> \~ changed (16 GitHub strikethroughs ->
  0). Archived reports stay as published.
- v1.10.4; CLAUDE.md §8, §13, §21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiRz5pTW83oqNbk2NC7yMR

@gitluis gitluis left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fully reviewed. PR is approved.

@gitluis
gitluis merged commit 9ba3e79 into master Nov 2, 2026
@gitluis
gitluis deleted the fix-tilde-strikethrough branch November 2, 2026 03:43
gitluis pushed a commit that referenced this pull request Nov 2, 2026
…ettings-database-tab

Carries master's v1.10.3-v1.10.5 up the stack: declined answers (#14),
literal single "~" (#15) and the Import Logs race fix (#18), with
clarity-insights' port of #14 to the rebuilt AI tab.

One conflict: CLAUDE.md's "Last updated" line. Kept this branch's
line and added the v1.10.3-v1.10.5 history. The CHANGELOG merged cleanly.
Versions stay 1.17.0. renderImportLog() keeps #18's guards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Z8iBXzUjiQbYziDZ8CZft
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.

2 participants