Repository navigation
fix(ui): render digit-led single-$ math — move currency guard to close side - #376
Merged
Merged
Conversation
#374 indexes Idempotency-Key/X-Session-Id on the static per-provider header union, which only carries the harmoniqs branch — the test file typechecks red at the branch base. Widen through a Record so the suite (and the pre-push typecheck gate) passes.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
aarontrowbridge
marked this pull request as ready for review
October 7, 2026 23:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #375.
What
The single-
$inline-math rule rejected any math whose opening$was immediately followed by a digit (an anti-currency guard on the wrong side). All digit-led inline math — the most common physics reporting shape, e.g..53\times10^{-5}$— fell through to markdown and rendered raw, while$\alpha$rendered fine, which made the failure look random.Fix
Move the digit guard 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"):singleDollarTokenizerRegexandsingleDollarInlineRegexdrop\dfrom the open-side lookahead and add it to the close side-and-pairs stay literal because the first closing$abuts a digit;and, env-var dollars, escaped\$, halves of `400591…$$, and code spans are all unaffected (test-covered).Testing
bun test src/context/marked-math.test.tsfrompackages/ui— 10 pass (2 new tests: digit-led positives incl. the two reported snippets, tight digit-pair currency negative)bun typecheckfrompackages/ui— clean; fullbun typecheckat repo root — 30/30 greenAlso includes: unblocking fix for the base branch
The base (
local/amicode@ 4cf9ef2) typechecks red — #374 indexes the runtime-injectedIdempotency-Key/X-Session-Idheaders on the static per-provider header union, so its own test file failstsgoand the pre-push/typecheck gate is blocked. Commit b2143c4 widens the lookup through aRecordin that test file only — no production code touched. @jack-champagne FYI, happy to split it into its own PR if you'd rather.Follow-up (after merge)
Re-extract the app-bundle overlay at the new fork tag so
drift_gate.mjsstays green (separate PR inharmoniqs/amicode), thenscripts/rebuild_amicode_locally.sh.