Skip to content

comark-ui sends diagram sources to kroki.io by default #446

Closed

Description

@onmax

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.

comark-ui 0.12.2, comark-diagrams 0.12.2.

Activity

  1. pullfrog commented on Nov 17, 2026

    @pullfrog

    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

    1. 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.
    2. 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.
    3. 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.
    4. 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

    Pullfrog  | Implement a fix ➔ | View workflow run | via Pullfrog | Using gpt-6.1-sol(xhigh) | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions