vitepress 2.0.0-alpha.10 → 2.0.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36931,7 +36931,11 @@ async function createMarkdownRenderer(srcDir, options = {}, base = "/", logger =
36931
36931
  ...options.sfc
36932
36932
  }).use(titlePlugin).use(tocPlugin, {
36933
36933
  slugify: slugify$1,
36934
- ...options.toc
36934
+ ...options.toc,
36935
+ format: (s) => {
36936
+ const title = s.replaceAll("&", "&");
36937
+ return options.toc?.format?.(title) ?? title;
36938
+ }
36935
36939
  });
36936
36940
  if (options.math) {
36937
36941
  try {
@@ -42189,18 +42193,19 @@ async function createVitePressPlugin(siteConfig, ssr = false, pageToHashMap, cli
42189
42193
  };
42190
42194
  const hmrFix = {
42191
42195
  name: "vitepress:hmr-fix",
42192
- async hotUpdate({ file, modules }) {
42196
+ async hotUpdate({ file, modules: existingMods }) {
42193
42197
  if (this.environment.name !== "client") return;
42194
- const importers = [...importerMap[slash(file)] || []];
42195
- if (importers.length > 0) {
42196
- return [
42197
- ...modules,
42198
- ...importers.map((id) => {
42199
- clearCache(id);
42200
- return this.environment.moduleGraph.getModuleById(id);
42201
- })
42202
- ].filter((mod) => mod !== void 0);
42198
+ const modules = [];
42199
+ if (file.endsWith(".md")) {
42200
+ const mod = this.environment.moduleGraph.getModuleById(file);
42201
+ mod && modules.push(mod);
42203
42202
  }
42203
+ importerMap[slash(file)]?.forEach((importer) => {
42204
+ clearCache(importer);
42205
+ const mod = this.environment.moduleGraph.getModuleById(importer);
42206
+ mod && modules.push(mod);
42207
+ });
42208
+ return modules.length ? [...existingMods, ...modules] : void 0;
42204
42209
  }
42205
42210
  };
42206
42211
  return [
@@ -46390,7 +46395,7 @@ async function generateSitemap(siteConfig) {
46390
46395
  });
46391
46396
  }
46392
46397
 
46393
- var version = "2.0.0-alpha.10";
46398
+ var version = "2.0.0-alpha.11";
46394
46399
 
46395
46400
  async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags, usedIcons) {
46396
46401
  const routePath = `/${page.replace(/\.md$/, "")}`;
package/dist/node/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { z as getDefaultExportFromCjs, A as c, B as clearCache, w as disposeMdItInstance, u as init, e as build, x as serve, y as createServer, C as version } from './chunk-BNWqDZk7.js';
1
+ import { z as getDefaultExportFromCjs, A as c, B as clearCache, w as disposeMdItInstance, u as init, e as build, x as serve, y as createServer, C as version } from './chunk-CwUP9ZhX.js';
2
2
  import { createLogger } from 'vite';
3
3
  import 'node:path';
4
4
  import '@shikijs/transformers';
@@ -1,7 +1,7 @@
1
1
  import { normalizePath } from 'vite';
2
2
  export { loadEnv } from 'vite';
3
- import { n as normalizeGlob, g as glob, c as createMarkdownRenderer, p as pMap, f as fs, m as matter, a as postcssPrefixSelector } from './chunk-BNWqDZk7.js';
4
- export { S as ScaffoldThemeType, e as build, y as createServer, i as defineAdditionalConfig, h as defineConfig, j as defineConfigWithTheme, d as defineLoader, b as defineRoutes, w as disposeMdItInstance, u as init, k as isAdditionalConfigFile, o as mergeConfig, r as resolveConfig, s as resolvePages, q as resolveSiteData, t as resolveSiteDataByRoute, l as resolveUserConfig, v as scaffold, x as serve } from './chunk-BNWqDZk7.js';
3
+ import { n as normalizeGlob, g as glob, c as createMarkdownRenderer, p as pMap, f as fs, m as matter, a as postcssPrefixSelector } from './chunk-CwUP9ZhX.js';
4
+ export { S as ScaffoldThemeType, e as build, y as createServer, i as defineAdditionalConfig, h as defineConfig, j as defineConfigWithTheme, d as defineLoader, b as defineRoutes, w as disposeMdItInstance, u as init, k as isAdditionalConfigFile, o as mergeConfig, r as resolveConfig, s as resolvePages, q as resolveSiteData, t as resolveSiteDataByRoute, l as resolveUserConfig, v as scaffold, x as serve } from './chunk-CwUP9ZhX.js';
5
5
  import path from 'node:path';
6
6
  import 'node:crypto';
7
7
  import 'node:module';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitepress",
3
- "version": "2.0.0-alpha.10",
3
+ "version": "2.0.0-alpha.11",
4
4
  "description": "Vite & Vue powered static site generator",
5
5
  "keywords": [
6
6
  "vite",