Skip to content

feat(editor): read and check a document with the page's parser options - #404

Merged
vite-hub[bot] merged 6 commits into
mainfrom
feat/editor-host-parser
Nov 11, 2026
Merged

vite-hub[bot] merged 6 commits into
mainfrom
feat/editor-host-parser

Conversation

@onmax

@onmax onmax commented Nov 11, 2026

Copy link
Copy Markdown
Owner

On a page that parses with registerDefaultPlugins: false, the editor turns every bare URL into a link on the first save. Drop renders that way: across its 57 public Markdown docs, 8 change what readers see after one save with createEditorCodec({ plugins }), and each one is a bare URL.

The reader always parses with Comark's defaults, so linkify reads https://… as a link and the writer stores <https://…>. The page doesn't link bare URLs, but it does read <…> as an autolink. checkMarkdown() misses it for two reasons. Its page pass can't express registerDefaultPlugins: false, and it compares only the text, which is the same before and after.

This PR adds registerDefaultPlugins next to plugins on checkMarkdown(), fromMarkdown(), createEditorCodec() and useComarkEditor()/<ComarkEditor>. When it's false, the reader follows the page on linkify and html, and always keeps frontmatter, task lists, components and attributes, which the schema models. The page pass now compares the page's trees before and after a save, not their text. It masks the key that comark-tabs, details and the other plugins derive ids from (hash(state.markdown)), so a rewrite alone doesn't count.

Comparing whole trees turned up two things the text check let through:

  • TeX loses text on save. The editor reads $$ \frac{n(n-1)}{2} $$ as text, so {2} reads as attributes and a save drops it. math-inline-and-display and math-aligned-steps now open read-only. Keeping TeX as an atomic node would make them editable again, as a follow-up.
  • Charts drew new SVG ids on each render. Vega numbers clip paths with a counter that keeps running across renders, so the same stacked chart rendered twice gave different HTML. The first commit renames them from a hash of the drawing, which keeps ids unique between charts on a page and the same between renders.
Drop's 57 public docs + one private draft, one save each main this PR
Same tree under Drop's own parser, and stable on a second save 50 58

The five new tests in editor.test.ts and the chart test fail on main. I ran the editor and chart tests, tsrs --noEmit and lint. I didn't run the e2e suite, and haven't tried it in a browser.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-11T11:30:18.173227Z
We couldn’t complete this review. Comment @codex review to try again.
2e3349b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important

Two P1 regressions need attention before merging: renderer-only builds now emit the chart parsers, and safe HTML documents can incorrectly open read-only. A separate P2 issue causes repeated charts to lose clipping beside a closed disclosure.

Reviewed changes — Reviewed both commits covering host-parser-aware editor conversion and deterministic chart SVG IDs.

  • Parser options: Added PageParser and threaded registerDefaultPlugins through Markdown conversion, the collaboration codec, and Vue bindings.
  • Save verification: Replaced the page-text comparison with AST/frontmatter comparison, masking source-derived identifiers and rejecting lossy TeX examples.
  • Chart IDs: Added drawing-hash-based SVG resource names and repeat-render coverage.
  • Documentation and validation: Updated the editor guide; build, typecheck, changed-file lint, and 245 focused tests pass. The preset suite reproduces CI’s failure at packages/ui/test/ui.test.ts:427; the repeated-chart clipping issue was also verified in Chromium.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

Comment thread packages/charts/src/draw.ts Resolved
Comment thread packages/ui/src/editor/markdown.ts Resolved
Comment thread packages/charts/src/draw.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ No new defects found in 209ba87. Approval remains pending on the existing unresolved review threads.

Reviewed changes — Reviewed the chart bundling fix added since the prior review at 2e3349b.

  • Moved SVG ID normalization: Applied deterministic renaming in the chart parse plugin after drawing, removing the dependency that retained chart parsers in renderer-only bundles.
  • Verified the fix: Rebuilt the workspace and passed all 61 chart/preset tests, including the renderer-only bundling regression, plus workspace typechecking and lint for both changed files.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@404

comark-badge

pnpm add https://pkg.pr.new/comark-badge@404

comark-cards

pnpm add https://pkg.pr.new/comark-cards@404

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@404

comark-cast

pnpm add https://pkg.pr.new/comark-cast@404

comark-charts

pnpm add https://pkg.pr.new/comark-charts@404

comark-chat

pnpm add https://pkg.pr.new/comark-chat@404

comark-chips

pnpm add https://pkg.pr.new/comark-chips@404

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@404

comark-code

pnpm add https://pkg.pr.new/comark-code@404

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@404

comark-colors

pnpm add https://pkg.pr.new/comark-colors@404

comark-comments

pnpm add https://pkg.pr.new/comark-comments@404

comark-critic

pnpm add https://pkg.pr.new/comark-critic@404

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@404

comark-details

pnpm add https://pkg.pr.new/comark-details@404

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@404

comark-diff

pnpm add https://pkg.pr.new/comark-diff@404

comark-embed

pnpm add https://pkg.pr.new/comark-embed@404

comark-fields

pnpm add https://pkg.pr.new/comark-fields@404

comark-figure

pnpm add https://pkg.pr.new/comark-figure@404

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@404

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@404

comark-github

pnpm add https://pkg.pr.new/comark-github@404

comark-icon

pnpm add https://pkg.pr.new/comark-icon@404

comark-include

pnpm add https://pkg.pr.new/comark-include@404

comark-keys

pnpm add https://pkg.pr.new/comark-keys@404

comark-links

pnpm add https://pkg.pr.new/comark-links@404

comark-linter

pnpm add https://pkg.pr.new/comark-linter@404

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@404

comark-mark

pnpm add https://pkg.pr.new/comark-mark@404

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@404

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@404

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@404

comark-media

pnpm add https://pkg.pr.new/comark-media@404

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@404

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@404

comark-outline

pnpm add https://pkg.pr.new/comark-outline@404

comark-properties

pnpm add https://pkg.pr.new/comark-properties@404

comark-qr

pnpm add https://pkg.pr.new/comark-qr@404

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@404

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@404

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@404

comark-sources

pnpm add https://pkg.pr.new/comark-sources@404

comark-steps

pnpm add https://pkg.pr.new/comark-steps@404

comark-table

pnpm add https://pkg.pr.new/comark-table@404

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@404

comark-tests

pnpm add https://pkg.pr.new/comark-tests@404

comark-time

pnpm add https://pkg.pr.new/comark-time@404

comark-ui

pnpm add https://pkg.pr.new/comark-ui@404

comark-xref

pnpm add https://pkg.pr.new/comark-xref@404

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@404

commit: 71b74f1

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important

The new JSON masking can throw on valid numeric frontmatter, preventing affected documents from loading in the editor.

Reviewed changes — Reviewed the source-key masking refactor in f2fd22d since the prior review at 209ba87.

  • Replaced recursive masking: Serialized page trees and frontmatter to JSON, replaced the source hash in that JSON text, and parsed the result before comparison.

Validation: the workspace build, typecheck, changed-file lint, and all 190 focused editor tests passed. A separate public-API reproduction confirms the new exception with both comark-tabs and the standard preset.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

Comment thread packages/ui/src/editor/markdown.ts Resolved
@vite-hub

vite-hub Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Completed 2026-11-11T19:37:59.271Z 10m 31s
View session Completed 2026-11-11T12:53:56.446Z 11m 33s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks.

Session

Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks.

Session

Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks.

Session

Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks.

Session

Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks.

Session

Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks.

Session

Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks.

View session

Pushed 71b74f1 with a documented Doctor suppression for the JSON replacer’s required string check. Reproduced TS0007; Doctor now reports zero warnings. `vp run packages:build`, package-local `vp test run test/editor.test.ts` (169 tests), focused `vp lint`, and `vp fmt --check` passed. Pullfrog: no valid findings on the starting HEAD; all supplied threads are resolved. Awaiting hosted checks.

View session

Pushed 44ee33a fixing Pullfrog P1 numeric-frontmatter masking, P1 page-parser unwrapping, and P2 duplicate chart clip IDs. All three regressions reproduced before repair. Package-local tests passed: 169 editor tests, 44 chart tests, and the renderer-only bundle regression. Builds and changed-file lint passed. Resolved all three open threads; awaiting hosted checks.

Session

Waiting for review checks before the next pass.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found; no P0 or P1 findings remain.

Reviewed changes — Reviewed 44ee33a, covering the fixes added since the prior review at f2fd22d.

  • Restored page-parser defaults: Removed editor-only parser settings from page-equivalence checks, keeping the reported safe HTML document editable and room-writable.
  • Confined source-key masking to strings: Preserved numeric frontmatter and property names while normalizing source-derived identifiers.
  • Namespaced chart resources by occurrence: Gave identical charts separate clip paths while retaining repeatable output, with regression coverage for an earlier copy inside a closed disclosure.

Validation: the workspace build, typecheck, changed-file lint, and all 254 focused editor/chart/preset tests passed. Independent checks through built public exports also confirmed both reported editor regressions are fixed.

Pullfrog  | View workflow run | Using gpt-6.1-sol(xhigh) | 𝕏

@vite-hub
vite-hub Bot merged commit 1f9bf52 into main Nov 11, 2026
6 checks passed
@vite-hub
vite-hub Bot deleted the feat/editor-host-parser branch November 11, 2026 19:56
This was referenced Nov 11, 2026
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.

1 participant