You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
comark-ui sends diagram sources to kroki.io by default #446
With the default comark-ui preset, every plantuml, graphviz/dot, d2, dbml and goat/svgbob fence goes to https://kroki.io while the document parses. A site that renders private docs, drafts or user content sends that source to a public third-party server without choosing to. The option comment and the comark-diagrams README say so, but the default is still on.
ViteHub's docs package turns it off for that reason (diagrams: false, then { draw: false } so the authored-SVG check stays), and only sends fences when a site sets diagrams: { server } or opts in.
Proposal: in the comark-ui preset, default diagrams to { draw: false }, so the fences stay code until the app passes diagrams: true or { server }. The plugin itself can keep https://kroki.io as its default for apps that add it on purpose. Mermaid isn't affected, since comark-pele draws it in the process.
It's a behavior change for apps that rely on the current default, so it fits a minor release with a line in the changelog.
No duplicate found in the similarity or keyword searches. The code confirms the report: the shared preset enables diagrams without options, and the plugin defaults to https://kroki.io and POSTs the fence source while parsing.
Implementation plan
Change only the shared preset default in packages/ui/src/index.ts: omitted diagrams should register the plugin with { draw: false }, retaining the authored-SVG safety check. Preserve explicit opt-ins (true and options objects), { draw: false }, and false disabling the plugin entirely. Distinguish omitted options from true before normalization, since optionsOf() maps both to undefined. All four renderer presets use this shared path.
Add public parse/render regression tests without the existing offline.diagrams override: all supported fence languages remain code with zero requests by default; true sends source to Kroki; { server } uses only that server; { draw: false } overrides drawing even with a server. Also verify authored SVG remains rejected, Mermaid still renders offline, and standalone comark-diagrams retains its current default.
Handle the docs integration explicitly.docs/plugins.ts shares configuration between static examples and the playground, and packages/ui/test/browser-plugins.test.ts currently expects D2 to render implicitly. Update the registration test and any intended remote-rendering configuration without blanket-enabling uploads for playground input.
Document the migration in the preset option comments, Getting started, package docs/READMEs, and skills/comark-ui/references/{ui,diagrams}.md: drawing now requires an explicit opt-in, and true uses the public server. Include the behavior change and restoration options in the next minor-release changelog.
Investigation only; no code changed.
Task list (3/3 completed)
Check duplicate candidates and relevant issue context
Inspect diagram defaults, documentation, and regression-test coverage
Post one concise, code-grounded implementation plan
Activity
pullfrog commentedon Nov 17, 2026
No duplicate found in the similarity or keyword searches. The code confirms the report: the shared preset enables diagrams without options, and the plugin defaults to
https://kroki.ioand POSTs the fence source while parsing.Implementation plan
packages/ui/src/index.ts: omitteddiagramsshould register the plugin with{ draw: false }, retaining the authored-SVG safety check. Preserve explicit opt-ins (trueand options objects),{ draw: false }, andfalsedisabling the plugin entirely. Distinguish omitted options fromtruebefore normalization, sinceoptionsOf()maps both toundefined. All four renderer presets use this shared path.offline.diagramsoverride: all supported fence languages remain code with zero requests by default;truesends source to Kroki;{ server }uses only that server;{ draw: false }overrides drawing even with a server. Also verify authored SVG remains rejected, Mermaid still renders offline, and standalonecomark-diagramsretains its current default.docs/plugins.tsshares configuration between static examples and the playground, andpackages/ui/test/browser-plugins.test.tscurrently expects D2 to render implicitly. Update the registration test and any intended remote-rendering configuration without blanket-enabling uploads for playground input.skills/comark-ui/references/{ui,diagrams}.md: drawing now requires an explicit opt-in, andtrueuses the public server. Include the behavior change and restoration options in the next minor-release changelog.Investigation only; no code changed.
Task list (3/3 completed)
gpt-6.1-sol(xhigh)| 𝕏