Skip to content

0.9.33

Choose a tag to compare

@github-actions github-actions released this 01 Sep 15:42
· 10 commits to develop since this release

Features

  • HTML (offline) export inlines local JS/CSS into a portable single filehtmlExport({ offline: true }) used to emit file:// <link> / <script src> tags pointing at the host's crossnote/dependencies/ directory (KaTeX CSS, Mermaid, WaveDrom, Vega, Reveal, Font Awesome). Those paths break when the HTML is copied to another machine. Offline HTML export now inlines those files (and rewrites CSS url() font references to data: URIs, preferring woff2). Open in Browser / Chrome PDF / Prince still use file:// so temporary documents are not bloated with mermaid.min.js (~3.5MB). CDN export is unchanged. An unreadable asset falls back to its file:// link instead of failing the whole export (a stale build directory no longer breaks offline export); url() references with ?query/#fragment suffixes resolve correctly, references escaping the CSS file's own directory are dropped, and inlined CSS escapes </style the same way inlined JS escapes </script. The reveal.js presentation.theme front-matter value is validated to a bare <name>.css filename before any file is read — a traversal value falls back to the default theme (white.css) rather than inlining an arbitrary file into the export.
  • frontMatterRenderingOption: 'vertical table' — a second table layout for front matter: instead of one column per key (which overflows the preview pane when there are many keys or long values), the table renders one key/value pair per row, matching the layout VS Code's built-in preview uses. Nested objects recurse vertically; array values stay a single row of cells. The existing 'table' (one column per key), 'none' and 'code'/'code block' options are unchanged (vscode-mpe#2371 reported by @JaeyeongYang).

Security

  • Reject IMGUR_API_URL overrides pointing at local or reserved addresses — the imgur image uploader sent its POST (upload payload + client id) to whatever host the IMGUR_API_URL env override named, with no validation; the override exists for self-hosted proxies, but nothing stopped it from naming localhost, 169.254.169.254 (cloud metadata), or any private address, which would turn the uploader into an inadvertent SSRF probe of the local network. The URL is now validated before any request is made: http/https only, and localhost/*.local/*.internal/*.home.arpa hostnames plus loopback/private/link-local/CGNAT/documentation/multicast/reserved IP ranges (including their IPv6 and IPv4-mapped forms) are rejected with a clear error. Found by a Mimosa security scan.
  • Contain the note-index walk to the notebook root — the walk behind refreshNotes / refreshNotesIncremental (wikilink resolution, backlinks, tags, graph view) could scan far beyond the workspace: a notebook rooted at a filesystem root (/, a Windows drive root — e.g. VS Code opened on /, a standalone file directly under it, or an untitled document whose fallback root is the /. spelling of /) recursively stat'ed and read files across the whole machine, and a symbolic link inside the workspace let the walk escape it entirely (followed links also risk cycles). Filesystem-root notebooks are now refused by all refresh entry points (a one-time warning explains that indexing is skipped), and the walk never follows symbolic links (Obsidian-style containment: link entries are not indexed). Walk-time readdir/stat failures such as EACCES/EPERM are also no longer console.error'd per directory — they are the normal cost of walking restricted trees, and logging each one is what made the scan visible as 1000+ error entries (vscode-mpe#2376 reported by @prawnsalad). wrapNodeFSAsApi().stat now reports isSymbolicLink() truthfully (lstat first, follow for metadata), matching the VS Code host adapter.

Bug fixes

  • Browser/HTML exports render in the configured theme again; following the reader's OS is now opt-in (exportColorScheme)0.9.32 made every screen export (Open in Browser, HTML export) follow the reader's system color scheme: the configured preview/code-block theme only selected which light/dark pair to embed, and the reader's OS picked the variant — so a document explicitly themed light rendered dark on a dark-OS machine, and one explicitly themed dark rendered light on a light-OS machine. Screen exports are deterministic again: by default they render exactly in the configured themes on every machine (this also keeps the 0.9.32 fix of no longer forcing github-light when printBackground is off). Following the reader's system color scheme — light/dark pairs under @media (prefers-color-scheme: dark) plus <meta name="color-scheme" content="light dark"> — is now opt-in via the new exportColorScheme: 'auto' notebook config, or per document with front matter html: { export_color_scheme: auto }. Paper output (Chrome PDF / Prince) keeps its forced-light behavior (vscode-mpe#2382 reported by @dada-xiv).
  • Fix preview crash on callouts whose marker line is its own paragraph — the callout renderer stripped the [!NOTE] marker line by nulling the paragraph's inline-token children and hiding the paragraph tokens, but markdown-it's Renderer.render() dispatches inline tokens without honoring hidden (only renderToken checks it, for block tokens), so renderInline(null) crashed with TypeError: Cannot read properties of null (reading 'length'). Any callout written with the marker line standing alone or followed by a blank quoted line — > [!NOTE], blank >, then the body — killed the entire preview. Regression from #463 in 0.9.32; the children are now emptied to an array instead (vscode-mpe#2375 reported by @GodExious).
  • Fix footnotes rendered inside a callout title — the callout title was rendered with md.renderInline(title, env), and renderInline's parse re-runs core rules with the document env; markdown-it-footnote's footnote_tail then re-emitted an empty copy of the document's footnotes section inside the callout title, in addition to the real one at the bottom. The title is now rendered with a fresh env, so footnotes appear exactly once, at the document bottom (vscode-mpe#2377 reported by @chz-cn).
  • Fix {highlight=...} band rendering below the code block in most code themes — only the vue and vscode code themes carried the structural CSS (position: relative on pre[data-line], absolutely positioned wrapper/band); github-dark had it partially (no wrapper positioning) and every other prism theme not at all, so the appended highlight divs rendered in flow below the code. The structural rules now live in the shared style-template.css (included by the preview and every export path) as the single source of structure, with a translucent default band; themes override the band color via the --line-highlight-background custom property (vscode blends VS Code's selection color, github-dark keeps its tuned tone), so the previously duplicated structural rules were removed from those themes (vscode-mpe#2379 reported by @chz-cn).
  • Fix {highlight=...} band covering code text with the vscode code theme — the band used --prism-selection (VS Code's editor.selectionBackground, opaque in most themes) as its background, painted over the text. It is now blended to 35% opacity via color-mix (the opaque color remains as a fallback for engines without color-mix support), and the variable's fallback default was normalized from an out-of-range rgba(264,264,264,…), which only worked through clamping, to rgba(128,128,128,0.25) (vscode-mpe#2378 reported by @chz-cn).