Repository navigation
feat(ui): list every enabled plugin's inline scripts in preset.scripts - #421
Conversation
Each package whose HTML renderer writes a <script> exports the exact text as scripts from /html, with the scripts of the packages it draws with. comarkUi() collects them for the plugins that are on, so a host with a strict CSP can hash them or add its nonce without rendering a document first. The Vue, React, and Svelte presets return an empty list.
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Latest result Pull request merged. Final answersSession Pull request merged. Pushed 7779809 resolving the prepared main merge and restoring repository guidance, including preset.scripts documentation. Lint passed with warnings. Focused tests require workspace builds; the prerequisite build hit a sandbox SQLite access failure. Thread resolution was rejected because the PR head changed; the next pass must resolve the restored-guide finding. Awaiting hosted checks. Session Pushed acf26af, resolving the merge conflict while preserving both lazy-highlighter documentation and CSP script guidance. All 17 focused tests passed; lint passed with warnings. Dependencies refreshed successfully. Earlier review findings remain fixed, with no outstanding P0 or P1 findings. Awaiting hosted checks and automated review. Session Pushed acf26af, resolving the merge conflict while preserving both lazy-highlighter documentation and CSP script guidance. All 17 focused tests passed; lint passed with warnings. Dependencies refreshed successfully. Earlier review findings remain fixed, with no outstanding P0 or P1 findings. Awaiting hosted checks and automated review. Session Pushed acf26af, resolving the merge conflict while preserving both lazy-highlighter documentation and CSP script guidance. All 17 focused tests passed; lint passed with warnings. Dependencies refreshed successfully. Earlier review findings remain fixed, with no outstanding P0 or P1 findings. Awaiting hosted checks and automated review. Session Pushed acf26af, resolving the merge conflict while preserving both lazy-highlighter documentation and CSP script guidance. All 17 focused tests passed; lint passed with warnings. Dependencies refreshed successfully. Earlier review findings remain fixed, with no outstanding P0 or P1 findings. Awaiting hosted checks and automated review. Session Pushed acf26af, resolving the merge conflict while preserving both lazy-highlighter documentation and CSP script guidance. All 17 focused tests passed; lint passed with warnings. Dependencies refreshed successfully. Earlier review findings remain fixed, with no outstanding P0 or P1 findings. Awaiting hosted checks and automated review. |
There was a problem hiding this comment.
Important
preset.scripts does not always match the final rendered script text, so the documented CSP allowlists block valid component runtimes.
Reviewed changes — Reviewed the new inline-script exports, preset aggregation, renderer integration, documentation, and regression coverage across all 20 changed files.
- Script exports: HTML packages share constants between their renderers and new
scriptsexports, including transitive carousel, annotate, and zoom runtimes. - Preset aggregation: Enabled HTML plugins contribute deduplicated script bodies; Mermaid follows its zoom setting, while framework presets return empty lists.
- CSP integration: The guide and agent reference document hashing or selectively adding nonces, and the new tests compare a combined document against the preset list.
- Validation: Focused tests passed (425 tests, one skipped), as did workspace typechecking and lint on the changed TypeScript files; isolated-render assertions and a controlled Chromium CSP comparison exposed the final-text mismatch described inline.
gpt-6.1-sol(xhigh) | 𝕏
There was a problem hiding this comment.
Important
One P1 regression remains: the new Unicode script separators break media runtime execution in responses without a declared charset, including the newly added CSP test.
Reviewed changes — Reviewed ab47d41, the fix added since the previous Pullfrog review.
- Normalized inline scripts: Replaced CR/LF line endings with U+2028 across HTML runtimes to keep exported bodies invariant under native-parent indentation.
- Added regression coverage: Expanded isolated and nested render assertions, script syntax checks, and a Chromium test using exported CSP hashes.
- Validated execution: Passed 445 package/preset tests, workspace typechecking, and changed-file lint; reproduced 19 failures in the 20-test media browser suite and isolated the charset dependency with controlled Chromium responses.
gpt-6.1-sol(xhigh) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes — Reviewed 515413b, the UTF-8 hosting fix added since the previous Pullfrog review.
- Documented UTF-8 hosting: Established the encoding requirement and explained why Unicode script separators need a declared charset.
- Updated HTML fixtures: Declared
charset=utf-8in both media response paths and added an explicit browser encoding assertion to the strict-CSP test. - Verified runtime execution: All 20 media browser tests and 13 focused renderer/preset tests passed, including exported-hash execution and blocking an unrelated document script; the workspace build, typecheck, and changed-file lint also passed.
gpt-6.1-sol(xhigh) | 𝕏
comark-annotate
comark-badge
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
There was a problem hiding this comment.
ℹ️ No P0 or P1 findings remain; one P2 documentation regression is noted inline.
Reviewed changes — Reviewed acf26af, the merge and reference-conflict resolution added since the previous incremental pass.
- Merged reference guidance, retaining main's lazy-highlighter documentation alongside the existing CSP
scriptsguidance. - Removed repository instructions, leaving
AGENTS.mdempty without changing the PR's runtime implementation.
gpt-6.1-sol(xhigh) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes — Reviewed 7779809, the merge resolution and repository-guide restoration added since the previous Pullfrog review.
- Restored repository guidance, recovering the architecture, verification, and release instructions while retaining the
preset.scriptscontract. - Preserved merge integration, keeping main's author-issues imports and reference guidance alongside the existing CSP script exports.
- Verified guide restoration, checking the required sections, retained script guidance, and absence of conflict markers in the overlap files. Runtime tests were not rerun because the PR-specific delta changes documentation only.
gpt-6.1-sol(xhigh) | 𝕏

A host with a strict Content Security Policy has no way to list the inline scripts comark-ui writes. Only
mermaidScriptand comark-outline'srailScriptwere exported, so Drop renders a fake zoom block and a fake properties box at startup and pulls each<script>out with a regex, and it still misses the others: carousel, tabs, code, table, charts, sources, media, magic move, quiz, annotate, and X embeds.This adds
scripts: string[]to the preset: the exact text of every inline script the HTML components can write, for the plugins that are on, each once. A host hashes them, or adds its nonce to each<script>whose text is in the list and leaves a document's own scripts blocked. Turning a plugin off drops its script, andzoom: falsedrops zoom's from Mermaid.Each package whose HTML renderer writes a script now exports its list as
scriptsfrom/html, and includes the scripts of the packages it draws with: carousel lists zoom's, annotate lists carousel's and zoom's, and charts lists annotate's for marks. The renderers write the same constant they export, so the two can't drift. The Vue, React, and Svelte presets return[], since their components run scripts from the bundle.mermaidScriptandrailScriptstay as they are.No visible change, so no screenshots. The renderers' HTML output is unchanged.
Validation:
packages/ui/test/scripts.test.ts: it renders one document with a block of every plugin that has a script, collects each<script>text, and checks it equalspreset.scripts(15 scripts). It also checks that turning plugins off drops theirs and that the Vue preset has none.vp test runon the whole workspace passes apart from tworemark-to-comarkCLI tests that timed out under load. That package isn't touched here.pnpm typecheck,vp lintandvp fmton the changed files,pnpm run doctorfor the 15 changed packages, andpnpm run lint:docs.