Repository navigation
Releases: brycewang-stanford/md2
Releases · brycewang-stanford/md2
Release list
md2 v0.2.7
Full Changelog: v0.2.6...v0.2.7
md2 v0.2.6: Zhihu & WeChat paste fixes
md2 v0.2.6: 知乎 images verified in the real editor, 公众号 paste fixes, and exports that no longer hang in the background.
Install
- VS Code: search md2 in the Extensions view, or
code --install-extension brycewang-stanford.md2(Marketplace). - Cursor / VSCodium / Windsurf: Open VSX.
- Or download
md2-0.2.6.vsixbelow and run Extensions: Install from VSIX….
Fixed
- 公众号 images no longer fail to paste (有 N 个内容插入失败). The WeChat editor fetches every pasted image from Tencent's servers, and "Copy for WeChat" was pasting local / webview image URLs. With WeChat credentials saved (the ones "Publish draft" uses), copy now uploads each image to WeChat's own CDN (mmbiz.qpic.cn); SVG badges are converted to PNG first. Without credentials, or if the upload fails, images map to public URLs as for Zhihu (
image_base, pushed files → jsDelivr / wsrv.nl), with base64 and a warning as a last resort. md2 wechatmaps local images the same way and takes--image-base/--no-git.- 公众号 paste keeps its layout. Callouts (
> [!TIP]…) keep their box: WeChat drops<div>, so they are now<section>. Task-list items no longer split the ☑ and the text onto two lines. The paste no longer triggers 内容结构检测 warnings: the claude theme's bold highlighter (and aurora's h3 marker) use an inset shadow instead of a gradient text background, and footnote markers no longer setline-height: 0. - Long image / Xiaohongshu export no longer times out when the VS Code window is in the background or covered by another window. The rasteriser waited for an animation frame, which Chromium doesn't fire for a page that isn't painting.
- 知乎 images, tested in the real editor. Paste tests showed Zhihu rejects
raster.shields.iobadges, and that a cold jsDelivr cache can fail. Badges now go through the wsrv.nl proxy as PNG, and GitHub-hosted images (your pushed files andraw.githubusercontent.com) try wsrv.nl first, then jsDelivr. On this README, all 20 images re-host correctly. Pasted base64 images do not work in Zhihu (it maps them all to one cached image), so md2 now warns that unpushed images must be pushed or given animage_base. - Copying large articles works. On macOS, copying more than ~1 MB (e.g. with inline images) silently failed (
osascript failed); the CLI and VS Code copy now handle any size.
md2 v0.2.5: Zhihu image fixes
md2 v0.2.5: more images survive the paste into the 知乎 editor.
Install
- VS Code: search md2 in the Extensions view, or
code --install-extension brycewang-stanford.md2(Marketplace). - Cursor / VSCodium / Windsurf: Open VSX.
- Or download
md2-0.2.5.vsixbelow and run Extensions: Install from VSIX….
Fixed
- More 知乎 images survive the paste. SVG images (shields.io / JOSS badges) are converted to PNG, since Zhihu only re-hosts raster images.
raw.githubusercontent.comimages, which Zhihu's servers in mainland China can't reach, go through jsDelivr. Every candidate is checked before copy and falls back to the wsrv.nl image proxy when jsDelivr times out on a cold cache, and md2 warns about any remote image with no reachable alternative.
md2 v0.2.4: on the VS Code Marketplace
md2 v0.2.4: now on the VS Code Marketplace as brycewang-stanford.md2.
Install the VS Code extension
- Search md2 in the Extensions view, or run
code --install-extension brycewang-stanford.md2. - Or download
md2-0.2.4.vsixbelow and run Extensions: Install from VSIX…. - Web app: https://brycewang-stanford.github.io/md2/
Changed
- md2 has its own preview button in the editor title bar: an
md2glyph instead of the stock preview icon, so it is no longer confused with VS Code's built-in Markdown preview. - Published on the VS Code Marketplace as
brycewang-stanford.md2. The extension ID changed frombrycewang.md2, so uninstall a sideloaded copy before installing from the Marketplace.
md2 v0.2.2: md2 logo
md2 v0.2.2: the logo now spells md2.
Install the VS Code extension
- Download
md2-0.2.2.vsixbelow, then in VS Code run Extensions: Install from VSIX…, or usecode --install-extension md2-0.2.2.vsix. - Web app: https://brycewang-stanford.github.io/md2/
Changed
- The logo now spells md2 (with the “d”) in the README, the VS Code extension icon, the web app header and the favicon.
Also includes the v0.2.1 fix for images showing 上传失败 when pasted into Zhihu.
md2 v0.2.1: Zhihu image paste fix
md2 v0.2.1: fixes images failing (上传失败) when pasting into the Zhihu editor.
Install the VS Code extension
- Download
md2-0.2.1.vsixbelow, then in VS Code run Extensions: Install from VSIX…, or usecode --install-extension md2-0.2.1.vsix. - Web app: https://brycewang-stanford.github.io/md2/
Fixed
- 知乎 images no longer show 上传失败. Zhihu re-hosts every pasted image by fetching its URL from Zhihu's servers, so local paths and VS Code preview URIs always failed. On copy (VS Code panel,
md2 zhihu --copy), local images now become public URLs: jsDelivr links pinned to the pushed commit for files already on GitHub, animage_basefront-matter /--image-baseprefix for your own host, or inline base64 as a last resort. The Zhihu tab now warns about any image Zhihu can't fetch.
Docs
- README split into English (
README.md) and 简体中文 (README.zh-CN.md), for the repo and the VS Code extension.
md2 v0.2.0: VS Code extension, threads, long images, Mermaid, AI
md2 v0.2: Markdown → 公众号 · 知乎 · 小红书 · X / Threads / Bluesky / LinkedIn · 长图 · 封面.
Install the VS Code extension
- Download
md2-0.2.0.vsixbelow, then in VS Code run Extensions: Install from VSIX…, or usecode --install-extension md2-0.2.0.vsix. - Web app: https://brycewang-stanford.github.io/md2/
New
- VS Code extension: live preview beside the editor with every md2 tab, scroll sync, copy and export commands that write into your workspace, WeChat draft publishing, and AI with keys in SecretStorage.
- Threads beyond X: Threads, Bluesky, Mastodon and LinkedIn, each with its own counting rules and image limits. Unicode-bold headings.
- 长图 (long image) export in the web app, CLI (
md2 long), MCP (md2_long_image) and VS Code. - Mermaid diagrams render to self-contained SVG (computed styles baked in, no
<style>, noforeignObject), so they survive pasting into WeChat. - AI copywriting (bring your own key): Claude through the official Anthropic SDK (default
claude-opus-5-5, structured JSON output, server-side refusal fallback) or any OpenAI-compatible endpoint. Covers 小红书 titles/caption/tags, thread rewrites, 公众号 headlines/digest and cover copy. Also available asmd2 ai …and themd2_aiMCP tool. - Fine-tuning: line height, paragraph and letter spacing, 首行缩进, justify, heading alignment and custom CSS (
--indent,--justify,--css… in the CLI). - English UI with a one-click 中文 / EN toggle, plus an English sample article.
- ⌘/Ctrl⇧C runs the current tab's main action.
- New logo.
Improved
- MathJax loads lazily, which halves the web app's initial download (1.15 MB → 0.55 MB gzipped).
- The CLI renders diagrams through headless Chromium, and
publish wechatno longer needs a browser when the article has a cover. - The MCP server closes idle browsers and shuts down cleanly.
Fixed
- The X thread no longer repeats the intro paragraph after the hook post, and keeps display formulas.
- Inline Zhihu formulas no longer render as display blocks in the preview.
- Long-image header fonts are no longer lost to quote escaping.