Skip to content

fix(app-bundle): digit-led single-$ math — move currency guard to close side - #1727

Open
aarontrowbridge wants to merge 1 commit into
mainfrom
overlay-reextract-amicode-23
Open

aarontrowbridge wants to merge 1 commit into
mainfrom
overlay-reextract-amicode-23

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #1725.

What

Port of harmoniqs/opencode#376 (the fix for harmoniqs/opencode#375): chat LaTeX like .53\times10^{-5}$ rendered raw because the single-$ inline-math rule rejected any math whose opening $ is followed by a digit.

Note on the issue's original framing: #1725 was drafted as an overlay re-extract at v1.18.10-amicode.23 — but the overlay doctrine changed since the fork absorption (#1091): the overlay is now the source of truth, maintained directly (fork archived, drift gate checks overlay↔manifest, not fork bytes). So this PR edits the overlay directly rather than re-extracting. The issue title predates that realization.

Changes

  • overlay/packages/ui/src/context/marked-parser.tsx — digit guard moved from the open side of the delimiter to the close side (Pandoc's actual currency rule: the closing $ must not be followed by a digit). -and- stays literal; .53\times10^{-5}$ renders.
  • overlay/packages/ui/src/context/marked-math.test.ts — 2 new tests: digit-led positives (the two reported snippets) + tight digit-pair currency negative; plus renderMathInText coverage.
  • manifest.json — auto-refreshed by materialize (851 files at exact hashes).

Verification

  • drift_gate.mjs — PASS (overlay and manifest in sync)
  • Materialized tree (upstream base + overlay): bun test src/context/marked-math.test.ts from packages/ui — 10 pass / 0 fail, through the real createMarkdownParser pipeline

After merge

scripts/rebuild_amicode_locally.sh + window reload; verify ($3.53\times10^{-5}$ — nice determinism check for free) renders in chat.

…se side

Port of harmoniqs/opencode#376 (closes #1725). The single-$ inline-math
rule rejected any math whose opening $ was followed by a digit; move the
digit guard to the close side (Pandoc's actual currency rule). Overlay is
post-absorption source of truth, so the fix lands directly in
marked-parser.tsx with the manifest refreshed (851 files, drift gate
green). Regression tests: the two reported digit-led snippets + tight
$30-and-$50 currency pair, verified in the materialized tree (10/10).
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e1459549-b51e-4967-8fab-24ac8415e1b7
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aarontrowbridge
aarontrowbridge marked this pull request as ready for review October 7, 2026 23:26
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.

chore(app-bundle): re-extract overlay at v1.18.10-amicode.23

1 participant