Canofold Markdown Preview for VS CodePreview any saved Install and useRequires VS Code 1.100+. Install Canofold Markdown Preview by Open a saved If the action has been hidden in your editor profile, open the title bar's The command palette also exposes Canofold: Preview with Canofold and Canofold: Edit Markdown Source as explicit one-way commands. Switching to preview saves dirty source first. Once open, the preview updates from the current text document, including unsaved edits. Relative images and links resolve from the Markdown file; links open through VS Code. The preview uses Canofold's light appearance independently of the editor's color theme. Raw HTML is sanitized; MDX code and Skill instructions are not executed. Project checksRun Canofold: Check Project from a file in a local workspace to check its nearest project declaring Checks require a trusted workspace and an extension-host Node.js runtime of at least 22.12. Preview remains available without project checks. Checks read saved files only: save or discard that project's unsaved edits before running the command; it does not save them for you. Results appear in Problems, with source locations only where supplied by the CLI. Project-level issues and OpenAPI pointers explicitly indicate that no exact source position is available. Cancel from the progress notification. Editing project files invalidates old results; run the command again after saving. Re-running replaces obsolete work, and separate projects keep separate results. This is an explicit project check, not automatic whole-site validation on every keystroke. Rendering and boundariesUnknown or invalid rich directives are displayed as inert source so valid surrounding content stays readable. Ordinary colon words such as Math, Mermaid, PlantUML, Graphviz/DOT, and D2 blocks are supported. Diagram source is rendered entirely on the local machine and is never sent to a public rendering service. Mermaid and PlantUML run in the isolated preview webview; Graphviz and D2 run in a dedicated Node.js worker owned by each preview and return only the generated SVG. Updating or closing a preview cancels obsolete work and releases its worker. Local HTML embeds display static content in a sandbox without scripts or same-origin access. Relative CSS, images, fonts, and CSS imports are included in the embedded document, with resource paths restricted to the workspace and its public directory; symbolic links are not followed. Each file is limited to 2 MiB, with at most 64 local resources and 16 MiB of combined resources or generated output. Missing assets show a warning without discarding the remaining content. Remote embeds require HTTPS and remain subject to the remote site's framing policy. The extension is an optional editor for saved DevelopRequires Node.js 22.12+, pnpm, and VS Code 1.100+.
Open this repository in VS Code and press To create a local VSIX after verification:
To run plugin and iframe tests in a real, isolated VS Code window, set
The tests cover first load, unsaved edits, failure recovery, and closing/reopening previews, including directive recovery, math rendering, and iframe resource and permission boundaries. For a local Core build, append To include checks against a real installed Canofold CLI, append LicenseMIT |