Bump compatible releases, including wrangler 4.151.2, CodeMirror view 6.43.15, and typescript-eslint 8.72.0. Retarget the CodeMirror view patch and raise undici to 8.12.3 now that the HTTP/2 content-encoding regression is fixed.
The same link colour (#576b95) was copy-pasted into all three built-in themes, and the blockquote background was only reachable through a shell-injected token, so both had to be overridden with custom CSS.
Link colour becomes an always-emitted --md-link-color, defaulting to the blue every theme already used. The theme-colour preset is stored as a literal var(--md-primary-color) so links keep tracking the primary colour rather than freezing its value at pick time.
Blockquote background cannot use the same shape: only the default theme has a background, while grace and simple are deliberately background-free. Declaring the variable unconditionally would give them a grey box they never had, so it is only declared when the user picks a non-default value and each theme keeps its own value as the var() fallback.
That relies on processCSS resolving a var() whose fallback is another var(), and on it leaving the unresolvable shell token intact. Both behaviours are now covered by tests, along with nested color-mix resolution.
Line height sat hard-coded as 1.75 in base.css and every vertical block margin was a literal in the theme CSS, so tightening or loosening an article meant hand-writing custom CSS across a dozen selectors.
Line height becomes --md-line-height. Block spacing becomes --md-block-spacing, a unitless multiplier applied to the margins each theme already defines rather than one flat value: a single length would collapse the theme's rhythm, where an h2 deliberately sits further from the text than a paragraph. Themes keep their proportions while the whole scale moves together.
The calc() indirection is safe for the WeChat paste because processCSS already flattens var() and calc() before juice inlines the styles; its multiplication branch handles a length times a unitless operand. cssVariables.test.ts pins that behaviour, which had no coverage before.
Both fields are optional end to end, so settings persisted before this change keep rendering identically and existing generateCSSVariables callers (VSCode preview, theme export) needed no signature change.
Superscript had no syntax at all, so ^2^ leaked through as literal text. Adds a markup_superscript inline extension rendering semantic <sup>, which degrades correctly even where the theme CSS is missing.
Unlike the sibling markup delimiters, superscript is meant to sit directly after a word char (x^2^), so it opts out of the shared word-boundary filtering and instead requires whitespace-free content. That keeps prose like 'a ^ b' and dangling carets like '2^10' literal. Ruby's [text]^(annotation) form is unaffected: its tokenizer is registered later and therefore runs first.
Subscript is deliberately left out because it would need the same single ~ delimiter already taken by the wavy-line extension.
Also gives <del> a theme class so strikethrough colour is themeable instead of relying on the browser default.
- Group posts by parent id once instead of re-filtering per tree node
- Collect headings during render instead of parsing the output HTML
- Debounce reactive persistence behind an in-memory overlay so sync
reads stay current; snapshot pending writes to localStorage on
pagehide and restore them on next launch so no state is lost
- Skip off-screen rendering via content-visibility for the post tree,
search results, and diff lines
- Preload the post-slider chunk when idle; pre-bundle diff-match-patch
so the dev server stops force-reloading on first interaction
* fix(web): fix post search misses and history restore timestamp
- extract search logic to lib/search-posts with a 250ms debounce; count matches via String.match (avoids stale-lastIndex misses of a reused global RegExp across posts) in a single scan for results and totals together
- render search results and history version entries as real buttons; make the history list width responsive on narrow screens
- bump post.updateDatetime on history restore so restored content is picked up by update-time sorting and cloud sync
Co-authored-by: Cursor <cursoragent@cursor.com>
* perf(web): replace deep post watches with signature watchers
- watch per-post signatures (id/title/content length/updateDatetime ms/parent/history length/collapsed) instead of deep-traversing every post on each editor commit; the old deep watch compared identical object identities and never persisted edits
- collect dirty post ids in a set and flush once per debounce window, so rapid edits across different posts are all saved (shared single-argument debounce used to drop earlier posts)
- inject heading anchor ids during render instead of assigning output twice, avoiding a second preview DOM rebuild
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor: dedupe escapeHtml/delay helpers and remove dead code
- share one escapeHtml in apps/api share pages and reuse @md/core's in the formula dialog
- centralize the delay() helper used by preview boot, PNG export and the editor header
- drop unused createTable/checkImage utilities and a stale debug comment
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(web): improve keyboard accessibility across editor UI
- make drag-drop upload areas, syntax help cards, JSON preview expanders and the footer line/col indicator keyboard-operable (real buttons or role/tabindex + Enter/Space)
- reveal hover-only controls (post item menu, table cell delete buttons) on keyboard focus via focus-visible
- add missing aria-labels to icon-only buttons, role=tablist to the CSS editor tabs, role=checkbox to multi-select, and move the collapse toggle out of the post row button to avoid nested interactives
Co-authored-by: Cursor <cursoragent@cursor.com>
* test(core): add render tests for footnote, toc, ruby, markup, slider and alert extensions
Co-authored-by: Cursor <cursoragent@cursor.com>
* ci: unify web type-check with build and include @md/shared in tests
- run the package's own vue-tsc --build --force for type-check:web so CI catches the same errors as pnpm web build
- add @md/shared tests to the root test script
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(ci): commit generated auto-import/components dts for type-check job
vue-tsc --build --force builds the referenced tsconfig.app.json, which includes auto-imports.d.ts and components.d.ts. Both were gitignored, so the CI type-check job (no prior vite build to regenerate them) failed with TS2304 for every auto-imported global (ref, useDark, useToggle, ...).
The previous vue-tsc --noEmit ran on the solution-style root tsconfig (files: [] + references) and checked zero files, which is why CI was green while real errors slipped through.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(web): guard zero-width search matches and clean up a11y semantics
- ignore zero-width regex matches when counting, highlighting and snippeting so empty-matching patterns (a*, ^, \b) neither match every post nor inflate counts to O(content length); replace skips zero-width positions and inserts the replacement literally
- give the multi-select checkbox an accessible name (new common.selectPost message)
- move the CSS tab more-actions button out of the role=tab element so each tab is a single focus stop
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
- create and edit GFM tables in a dialog with row/column steppers,
per-column alignment cycling, and cell keyboard navigation
- open in edit mode from the editor context menu (position-aware via
posAtCoords), the insert dropdown, slash command, and command palette
- click a table in the preview to edit it, mapped positionally through
a marked-parity scanner (fence/blockquote/indentation aware)
- preserve original indentation on update, re-locate tables safely when
the document changed while the dialog is open, and swallow surplus
blank lines on delete
- guard ResizablePanel.resize() calls against reka-ui mount races
- Scope the manualChunks highlight.js rule to the package root so
@antv/infographic's select-highlight.js no longer drags roughjs,
measury fonts, culori and tinycolor2 onto the critical path
(highlight chunk: 281 kB -> 57 kB min)
- Only pin core @lezer packages (common/lr/highlight/markdown/html)
in the codemirror chunk; language grammars follow the lazy
LanguageDescription.load() chunks again (1,019 kB -> 624 kB min)
- Drop css/javascript language setups from the shared editor barrel;
lazy consumers import them via '@md/shared/editor/css' and
'@md/shared/editor/javascript' instead
- Replace jszip with fflate (already bundled via @md/core) for the
CSS-theme and posts ZIP exports; remove the jszip dependency
- Fix Vite native-config-loader warnings: replace __dirname with
fileURLToPath(import.meta.url) and add the .ts extension to the
local plugin import
WeChat's media/uploadimg endpoint returns a JSON body with a text/plain
Content-Type. The fetch wrapper that replaced axios only parsed
application/json responses, so the body stayed a string, res.url was
undefined, and the client reported "no URL returned" even though the
image had been uploaded successfully.
Restore axios-like lenient JSON parsing for non-JSON content types and
surface the WeChat errcode/errmsg detail in mp token/upload errors.
#1877
Drop the pinia exports types patch after verifying vue-tsc works without it, and bump wrangler, Cloudflare Vite plugin, AWS SDK, and CodeMirror markdown.
Ship theme publish/review/install with sample markdown preview, admin moderation,
and system notifications (footer bell) for pending/approve/reject without email.
Move usage guidance into an i18n tips dialog, provide locale-specific skeleton templates, and keep the CSS editor font stable across language switches.
Move cross-package toolchain versions into a workspace catalog, declare
CodeMirror where it is imported, unify typescript-eslint via overrides,
and run pnpm dedupe to shrink the lockfile.
Translate valuable Chinese comments and remove noise that only restates the next line. Document the English-comment convention in AGENTS.md and CONTRIBUTING.md. Leave i18n and user-facing strings unchanged.
Drop uuid/es-toolkit/spark-md5/axios/language-data from the hot path,
lazy-load html-to-image/crypto-js/image compression, shrink highlight.js
and CodeMirror fence languages, and replace axios with a fetch wrapper.
Inject RenderMessages for footnotes, unknown components, and KaTeX loading.
Move generatePureHTML/sanitizeHtml into @md/core and drop marked/dompurify from web.
Add merge and clipboard unit tests; fix merge changed flag on no-op history.
Add cursor: pointer to .katex-inline and .katex-block in default theme
to visually hint that formula containers support horizontal swipe gestures
when content overflows.
Prevent Ctrl+Z from restoring previous article content after creating
or switching posts. Manage history via Compartment and flush pending
edits to the leaving post before switching.
Closes#1726
Track async diagram render state with data-md-diagram-state so preview readiness no longer depends on Chinese loading/error text. Inject localized diagram messages from the web renderer and add unit tests for pending detection and placeholder stripping.
Add Google Gemini, xAI Grok, Mistral, OpenRouter, Groq, MiniMax, and StepFun providers with updated model lists for existing vendors. Align DeepSeek and Zhipu base URLs with official docs and add matching zh-CN/en-US service labels.
Localize AI service labels, upload host options, and image validation errors through new composables. Fix HelpDropdown formatting and replace hardcoded Chinese store labels in shared config.
Add vue-i18n for zh-CN and en-US across the web app UI including editor, AI tools, dialogs, and stores. Introduce preferences dialog with locale cloud sync, localized built-in components and style options, boot screen language detection, and remove deprecated isEditOnLeft setting.
Add parallel type-check and test jobs to GitHub Actions, expand root type-check to web and workspace packages, and introduce Vitest tests for @md/core renderer and utilities.
Persist document deletes to IndexedDB immediately instead of relying on debounced saveAll, and push sync tombstones before pull so deleted posts are not restored on refresh.
Also remove unused dependencies, relocate build script deps to @md/web, migrate tailwindcss-animate to tw-animate-css for Tailwind 4, and trim stale pnpm-workspace config.
Restore vertical spacing between alert blockquotes in exported HTML by
only resetting horizontal blockquote margins in base.css.
Wait for mermaid/plantuml/infographic/math rendering before WeChat
clipboard copy and HTML/PDF export; strip unresolved loading placeholders.
Defer MathJax, Prettier, Mermaid, dialogs, and upload SDKs from the initial bundle. Split web utils modules, load MathJax on demand with safe katex fallbacks, and make cloud sync non-blocking on boot.
Enable GitHub upload backend on md-api, remove embedded frontend PATs, and consolidate default upload through uploadDefaultImage(). Anonymous uploads are supported; login still improves rate limits.
Exported/standalone HTML lacks the app's Tailwind preflight and
.preview rules, so browser UA defaults leaked through and app-global
CSS variables were undefined.
* Align the rendered root section class and custom theme template with .container, migrate legacy selectors in cssScopeWrapper, and scope base container styles to #output.
* Increase gaps between footer controls and group account, sync, and theme actions with tighter spacing.
Add theorem-family alert variants (theorem, lemma, corollary, proposition,
definition, axiom, postulate, assumption, proof, remark) with dedicated
theme colors and icons.
Allow an optional custom title after the type in both blockquote
(> [!TYPE] title) and container (::: type title) syntax, and render any
unknown name (including non-ASCII) with a neutral fallback style using the
name as the title. Callout bodies keep full Markdown and KaTeX support.
Update MCP explain_extensions docs and the example markdown accordingly.