fix(notes): render numeric comparisons without changing source - #3215
fix(notes): render numeric comparisons without changing source#3215binaricat wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex reported no major issues. This PR is marked ready for human review/merge. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex reported no major issues. This PR is marked ready for human review/merge. |
Summary
Notes containing ordinary numeric comparisons such as
内存<1GB设备cannot be read or edited as formatted Markdown. The JSX tokenizer mistakes<1for the start of a tag and rejects the entire document. This was reproduced with the author's complete note and the minimal comparison, before making changes.On v1.1.82 the failed import looks blank. Current main already includes #3175's source fallback, so it shows raw source instead; that safeguard does not fix formatted reading. This PR makes numeric comparisons render normally while keeping that fallback for unsupported input.
Type of Change
Related Issue (optional)
Related to #3205. Leave the issue open; this PR is not authorized for merge.
Changes Made
patch-packagepatch to both development and production exports ofmicromark-extension-mdx-jsx. When<is followed by a digit,=,+,-, or., let the normal Markdown parser keep the text instead of throwing a JSX error. The source is not preprocessed, and HTML handling stays enabled.Scope: numeric comparisons only. Unclosed tag-like text such as
<host>still uses #3175's editable/read-only source fallback. This does not attempt general MDX/CommonMark compatibility. Rich-text edits retain the editor's existing Markdown serialization (e.g. escaping a literal<); viewing alone preserves the original bytes. The fixture intentionally keeps its author's two-space Markdown line break.Screenshots / Demo
Manually exercised the real
InlineMarkdownEditorin a local Vite page and in a separately built production version of that page:Browser checks were on macOS using the actual Notes component, not a packaged Windows application. No commands from the note were executed.
Testing
npm run lint)npm test): 10,966 passed, 12 skipped, zero failures using Node 24 after restoring Electron 42.3.3npm run generate:capability-tools) — not applicableAdditional checks:
node --conditions development --test --import tsx components/notes/InlineMarkdownEditor.unrenderableMarkdown.test.tsx.npm cisuccessfully applied the committed dependency patch automatically.npm run buildpassed, followed by actual interaction with a production-built component page.Checklist