Commit Graph
37 Commits
Author SHA1 Message Date
Libin YANG d9132ab5a1 chore(deps): upgrade project dependencies (#1985) 2026-10-09 09:50:23 +08:00
Libin YANG 9bae922611 chore(deps): bump dependencies to latest compatible versions (#1978)
Upgrade pnpm to 12.6.0 and refresh direct packages, including VueUse 15,
Mermaid 12, and juice 12.2.0. Keep Prettier 2.8.8, TypeScript 6.0.3, and
the wrangler 4.134.0 preview-deploy pin.
2026-09-29 17:37:06 +08:00
Libin YANG 9227e937cf feat(theme): make link color and blockquote background configurable (#1939)
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.
2026-08-29 08:51:42 +08:00
Libin YANG 5adb849ac7 feat(theme): make line height and block spacing configurable (#1938)
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.
2026-08-29 08:43:55 +08:00
Libin YANG 83bf5583f5 feat(core): support GitHub-style emoji shortcodes (#1937)
Adds an inline extension turning 🚀 into an emoji character, so documents written on GitHub, Obsidian or Typora keep rendering the same glyphs instead of leaking raw shortcodes into the article.

The shortcode table is bundled in-repo rather than pulled from a dependency. The established emoji packages either carry several transitive dependencies or have negligible download counts, neither of which suits a widely used editor. The table is curated (515 entries) instead of the full ~1900-entry Unicode set, which would otherwise land in the deferred renderer chunk for a feature most articles use a handful of times.

Only names present in the table are consumed, so incidental colon pairs like 'ratio 3:4:5' and unknown names stay literal rather than disappearing. Emoji are emitted as bare characters with no wrapper element, leaving nothing for WeChat's sanitizer to strip and no theme CSS to keep in sync.
2026-08-29 08:27:51 +08:00
Libin YANG 91256df56a feat(core): add superscript syntax and theme strikethrough (#1936)
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.
2026-08-29 08:14:00 +08:00
Libin YANG 1a8dc8c073 refactor: replace yup and front-matter, upgrade MCP to 2.x (#1927) 2026-08-23 11:08:23 +08:00
YangFong d7e8b9ca80 refactor: remove deprecated baseUrl from tsconfigs (#1921)
baseUrl is deprecated in TypeScript 6.0 and scheduled for removal in 7.0. Since TS 4.1, path aliases resolve relative to the tsconfig directory, so the option is redundant and can be dropped without changing resolution behavior.
2026-08-20 20:03:40 +08:00
Libin YANG 74b2723d38 build(deps): bump dependencies to latest compatible versions (#1871) 2026-07-29 20:13:51 +08:00
Libin YANG 58f09a8897 build: centralize shared deps with pnpm catalog and dedupe (#1791)
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.
2026-07-11 13:38:58 +08:00
Libin YANG 800e109b32 perf(web): skip unchanged renders and split oversized editor UI (#1786)
Add debounce+max-wait preview scheduling and fingerprint skip in renderStore.
Extract scroll-sync/post-tree helpers with tests; cover API origin/sanitize.
Extend type-check to vscode/mcp; split Footer and CustomComponent form panels.
2026-07-11 09:37:29 +08:00
Libin YANG 4a39d069ee build(deps): bump @types/node and vue-tsc (#1761) 2026-07-08 19:55:46 +08:00
Libin YANG a83dfb837b build(deps): bump workspace dependencies and refresh lockfile (#1750)
* Upgrade @codemirror/view, Cloudflare tooling, AWS SDK, Vite, Wrangler,
webpack, and related packages. Regenerate the CodeMirror patch for 6.43.5.
Keep prettier pinned at 2.8.8 and mathjax at 3.x.
* Downgrade @cloudflare/workers-types from v5 to 4.20260702.1 to satisfy
wrangler@4.107.0 peer requirement (^4.20260701.1) and clear pnpm peer warnings.
2026-07-05 18:47:46 +08:00
Libin YANG a545cb5976 build(deps): upgrade project dependencies (#1727)
Bump @types/node to 26.0.1 and @cloudflare/workers-types to 4.20260625.1.
Keep prettier pinned at 2.8.8 per project policy.
2026-06-25 10:38:24 +08:00
Libin YANG 5852da6159 build(deps): upgrade dependencies except prettier (#1701)
Bump @aws-sdk, @cloudflare/*, @lucide/vue, isomorphic-dompurify,
wrangler, and @types/node to latest versions.
2026-06-19 21:33:34 +08:00
Libin YANG 34f2290b7f build(deps): upgrade all dependencies and fix esbuild CVE (#1666)
Bump workspace packages to latest while keeping prettier at 2.8.8.
Add esbuild override (>=0.28.1) to resolve GHSA-g7r4-m6w7-qqqr.
2026-06-13 11:45:07 +08:00
Libin YANG 704392a103 feat(core): support academic environments and custom callout titles (#1653)
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.
2026-06-10 20:16:17 +08:00
Libin YANG 9fe46ab1f6 feat(mcp-server): expand render options and add Cursor MCP config (#1651)
Add font, legend, heading styles, code block theme, and custom CSS parameters to render_markdown for parity with the web editor. Extract config-options and render-article modules, add style discovery tools, fix double container wrapping, and ship .cursor/mcp.json for Cursor IDE integration.
2026-06-10 12:53:21 +08:00
Libin YANGandCursor 60d9df8dd8 refactor(core): replace any types in marked extensions (#1647)
Add typed custom tokens and renderer adapters compatible with marked's
Tokens.Generic API. Introduce FrontMatterData and sync AGENTS.md plus
mcp-server README with current implementation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 14:46:36 +08:00
Libin YANGandClaude Opus 4.8 34f95b1bed chore(deps): upgrade workspace dependencies (#1633)
- @types/node: ^25.9.1 → ^25.9.2
- @aws-sdk/client-s3: ^3.1062.0 → ^3.1063.0
- @aws-sdk/s3-request-presigner: ^3.1062.0 → ^3.1063.0
- isomorphic-dompurify: ^3.15.0 → ^3.16.0 (core, web, vscode)
- @cloudflare/workers-types: ^4.20260605.1 → ^4.20260606.1

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 22:29:00 +08:00
Libin YANGandClaude Opus 4.8 ab0886df9e chore(deps): upgrade workspace dependencies (#1626)
* chore(deps): upgrade workspace dependencies

* chore(deps): upgrade workspace dependencies

- @aws-sdk/client-s3: ^3.1057.0 → ^3.1059.0
- @aws-sdk/s3-request-presigner: ^3.1057.0 → ^3.1059.0
- @cloudflare/vite-plugin: 1.39.0 → 1.39.1
- @cloudflare/workers-types: ^4.20260530.1 → ^4.20260531.1
- rollup: ^4.60.4 → ^4.61.0
- vite: ^8.0.14 → ^8.0.16
- wrangler: ^4.95.0 → ^4.96.0
- tsx: ^4.22.3 → ^4.22.4

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 19:21:37 +08:00
Libin YANG 3a71c38f0f chore: upgrade deps (#1565) 2026-05-21 13:01:43 +08:00
Libin YANG 51ffa3e782 chore: upgrade deps (#1561) 2026-05-20 22:43:35 +08:00
Libin YANG 8801b19af5 chore: upgrade deps (#1550) 2026-05-19 15:09:18 +08:00
Libin YANG 5a5ffc9878 chore(deps): upgrade all dependencies (#1544)
- Root: @types/node ^25.7.0 -> ^25.8.0, eslint ^10.3.0 -> ^10.4.0
- apps/web: @aws-sdk ^3.1045 -> ^3.1048, @cloudflare/vite-plugin 1.36.3 -> 1.37.1,
  @cloudflare/workers-types ^4.20260511 -> ^4.20260516, @vitejs/plugin-vue ^6.0.6 -> ^6.0.7,
  rollup ^4.60.3 -> ^4.60.4, vite ^8.0.12 -> ^8.0.13, vue-tsc ^3.2.8 -> ^3.2.9,
  wrangler ^4.90.0 -> ^4.92.0
- apps/vscode: isomorphic-dompurify ^3.12.0 -> ^3.13.0, @types/vscode ^1.118.0 -> ^1.120.0
- packages/core: fflate ^0.8.2 -> ^0.8.3, isomorphic-dompurify ^3.12.0 -> ^3.13.0
- packages/example: wrangler ^4.87.0 -> ^4.92.0
- packages/mcp-server: tsx ^4.21.0 -> ^4.22.0, @types/node ^25.7.0 -> ^25.8.0
- packages/shared: axios ^1.16.0 -> ^1.16.1
- Update pnpm-lock.yaml accordingly
- Prettier remains pinned at 2.8.8
- @codemirror/view remains pinned at 6.42.1 (override + patch)
2026-05-16 14:12:30 +08:00
Libin YANG 13aed080af chore: upgrade deps (#1537) 2026-05-12 14:56:03 +08:00
Libin YANG a46024c9ee chore: upgrade deps (#1523) 2026-05-05 10:37:32 +08:00
Libin YANG d64f9ee2c0 fix(mcp-server): fix broken startup and KaTeX polyfill issues (#1522)
- Switch mcp.json and package.json scripts to use run.mjs as entrypoint so DOM/MathJax polyfills are set up before tsx loads the TS source
- Fix polyfill.mjs: add missing window.MathJax reference and remove leftover writeSync debug output
- Pin jsdom>undici to ^7.25.0 via pnpm-workspace.yaml overrides to prevent pnpm from resolving it to undici@8 which dropped lib/handler/wrap-handler.js, causing the server to crash on startup
2026-05-05 10:11:41 +08:00
29f00569d0 feat(mcp): add primaryColor support, list_colors tool, and fix polyfill loading (#1521)
- Add primaryColor parameter to render_markdown and new list_colors tool
- Inline colorOptions/themeOptions to avoid CSS ?raw import issues
- Add run.mjs wrapper and polyfill scripts to fix MathJax/loading timing
- Improve type safety, error handling, and code review feedback

Co-authored-by: Bing <binner.chen@qq.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 08:32:24 +08:00
Libin YANG adaa865cdd chore: upgrade deps (#1509) 2026-04-30 16:08:52 +08:00
Libin YANG bf600db051 chore: upgrade deps, replace PostCSS with browser-native CSS processor (#1478)
- Upgrade marked, wxt, @aws-sdk, eslint, typescript, and other outdated
  packages
- Remove postcss/postcss-calc/postcss-custom-properties from @md/core
- Rewrite cssProcessor.ts using getComputedStyle + pure-JS var()/calc() resolver
- Add .gitignore rule to exclude compiled .js/.js.map from vscode/src/
2026-04-18 10:46:56 +08:00
Libin YANG 57931bfad6 chore: upgrade typescript to v6 (#1456) 2026-04-12 10:48:48 +08:00
Libin YANG ea6e315855 chore: upgrade deps (#1452) 2026-04-11 07:35:33 +08:00
Libin YANG e5534f4c05 chore: upgrade deps (#1435) 2026-04-04 09:17:18 +08:00
Libin YANG 1a80e3aa76 chore: upgrade deps (#1422)
close #1421
2026-03-31 20:19:59 +08:00
Libin YANG 08ed39e3f6 chore: upgrade deps (#1404) 2026-03-27 20:29:11 +08:00
Libin YANG 7fe808d680 feat: add mcp server (#1401) 2026-03-25 20:46:07 +08:00