Repository navigation
0.9.42
Bug fixes
- Pandoc math rendering no longer trips the pandoc 3.11 deprecation warning — pandoc 3.11 deprecated the bare
--mathjaxand--katexflags in favour of--math-method=…, and crossnote passed the old flags on every pandoc-parser render — worse than a log line, pandocRender turns any stderr into a visible error block above the document, so every preview of a note with MathJax or KaTeX showed[WARNING] Deprecated: --mathjax…. The flags are now chosen per pandoc binary:--math-method=mathjax/katexwhen the configured pandoc understands it (probed once per binary), the legacy flags otherwise — older pandoc rejects the new option outright, so an unconditional switch would have broken every pandoc before 3.11. Output is byte-identical between the two spellings; the probe caches its promise so concurrent parses share onepandoc --versionrun (#531 by @shd101wyy; #529 reported by @nredick).
Features
```csvcode blocks render as tables — a fencedcsvblock is now parsed with papaparse (the same parser@import "file.csv"uses) and shown as an HTML table, with the first row as the header. Quoted cells may contain commas, the delimiter is auto-detected (so;-separated data works too), and every cell is HTML-escaped. Add{code_block=true}to show the CSV source instead, as with the other diagram blocks. A malformed block shows the parse error in place of the table (#527 by @iryansa; vscode-mpe#1534 reported by @8).
Improvements
- Large notebooks index meaningfully faster — profiling the full index build on a 1,850-note notebook (
~/Workspace/Yo) showed the walk calling stat on every file and thenloadNoteFromDiskstat'ing each one again to decide whether it was indexable markdown, so every non-markdown file in the tree paid two stats to be rejected, and files within one directory were stat'd and read strictly sequentially. The walk now applies the markdown-extension andmaxNoteFileSizegates itself (one stat per entry, results handed to the loader) and processes a directory's entries concurrently; subdirectory recursion,.gitignorehandling, symlink refusal and the runaway-walk warning are unchanged. Measured on the profile notebook: the load phase drops from ~2.6 s to ~2.0 s warm-cache (the gap widens on a cold cache, where the removed stats and parallel reads are more expensive), stat calls fall from ~15,300 to ~8,300 for 1,849 notes, and the index contents are byte-identical. The remaining cost is the per-note markdown-it tokenization (~2.8 s of pure CPU on that notebook), which is sequential single-threaded work; making it cheaper would require either a second, leaner parser instance whose token stream would subtly diverge from the renderer's, or worker threads — both deliberately left out (#532 by @shd101wyy).
Bug fixes
-
GitHub-style light/dark
<picture>images show in the preview, and follow the preview theme — READMEs mark theme variants with<picture><source media="(prefers-color-scheme: dark)" srcset="…-dark.svg"><img src="…-light.svg"></picture>. The preview resolved<img src>to a loadable URL but leftsrcsetrelative, so it resolved against the webview document (vscode-webview://<uuid>/): whenever the dark<source>matched, the browser committed to it and showed a broken image instead of falling back to the<img>.srcseton<img>and<source>is now resolved exactly likesrc, one candidate URL at a time, keeping1x/480wdescriptors. This also fixes Open in Browser and Chrome (PDF/PNG) export, which render with absolutefile://URLs; HTML export keeps relative paths and is unchanged. Inside the preview,prefers-color-schemereports the system scheme, which can differ from the preview theme, so a<source>whosemediais exactly aprefers-color-schemequery is now matched against the preview's rendered background (the same test that setsdata-preview-theme) and re-evaluated when the theme changes — as on GitHub, the image follows the page it is drawn on. Other media queries, and exported HTML (seeexportColorScheme), keep standard browser behavior (#521 by @eneskemalergin; vscode-mpe#2271 reported by @garysassano). -
@importof files without an extension, and data URI images, work again — since the Obsidian-style link resolution (#429),@import "x"and a loneresolvexthroughresolveWikilink(), which appends.mdwhen there is no extension.@import "Caddyfile"therefore failed withENOENT … Caddyfile.md(before #429 it was shown as a broken image), contrary to the documented "all other files will be rendered as code block" (vscode-mpe#2236 reported by @traits); and aalone on a line was treated as a file import ofdata:image/….md(vscode-mpe#2241 reported by @piknockyou). A lone data URI image is now an ordinary image; an extensionless name that exists as written next to the note is imported as that file (and shown as a code block), while@import "note"still findsnote.md; and a target without an extension is treated as an image only for remote URLs andimage syntax. markdown-it also acceptsdata:image/svg+xmlinnow — it already allowed PNG, GIF, JPEG and WebP, and raw HTML<img src="data:image/svg+xml,…">already rendered, so this allows nothing new.javascript:anddata:text/htmllinks are still rejected (#523 by @eneskemalergin). -
@importby absolute location works again: Windows paths andfile://URLs — since the Obsidian-style link resolution (#429), an import target that does not start with/goes throughresolveWikilink(), which in the defaultrelativemode joins it under the note's folder (D:\notes\C:\folder\my-style.less), so<!-- @import "C:/folder/my-style.less" -->(which worked up to MPE 0.8.20) no longer found the file. Afile:///C:/folder/my-style.lessURL was handed to the file reader as-is and failed withENOENT(vscode-mpe#2349 reported by @suminosin). Windows drive and UNC paths are now used as written, andfile://URLs are read from the file they name. Afile://.cssimport is still linked by itsfile://URL, which the VS Code preview cannot load;.lessis compiled inline and works. A leading/still means the project root..jsimports keep their notebook-directory-only rule, and afile://.jsimport still emits no script (#524 by @eneskemalergin). -
Local image and link URLs are no longer double-encoded, and
@importimages load again outside the preview — sinceaddFileProtocol()switched topathToFileURL()(#468),resolveFilePath()fed it link text that was already a URL: markdown-it percent-encodesto%E5%9B%BE.png, so Open in Browser and Chrome (PDF/PNG) export, which render with absolutefile://URLs, got%25E5%259B%25BE.pngand the image was missing (vscode-mpe#2441 reported by @NarrowWoodBridge); and the?cache-busterthat@import "image.png"appends became part of the file name (image.png%3F0.55), which broke imported images in Open in Browser and Chrome export and in hosts that map file paths to URLs themselves (such ascrossnote serve). HTML export keeps relative paths and was not affected (vscode-mpe#2328 reported by @ahoy123).resolveFilePath()now splits the?query#fragmentoff the link, decodes the path once, resolves it, and re-attaches the suffix to the URL the host built, so hosts always receive a real file path.@importimages now write their path as a URL (#,?,%, spaces and parentheses escaped) instead of only replacing spaces. A file whose name contains a literal%xxsequence is now read the way a browser reads the link (a%20b.pngmeansa b.png). Notebook-root-relative destinations in relative renders (/img.png with useRelativeFilePath) are now written as URL paths (forward slashes, %, #, ? and spaces escaped) with the query/fragment preserved, instead of raw OS paths. As a side effectand[x](other.md#section)keep their fragment instead of having it encoded into the file name (#522 by @eneskemalergin).