\u003C/svg>',\r\n\r\n```\r\n\r\n### Expected behavior\r\n\r\nAdd `width=\"24\" height=\"24\" `attribute\r\nLike this\r\n```txt\r\n'\u003Csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">' \r\n```\r\n### System Info\r\n\r\n```sh\r\nSystem:\r\n OS: Linux 6.3 Kali GNU/Linux Rolling 2023.3\r\n CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz\r\n Memory: 8.21 GB / 15.24 GB\r\n Container: Yes\r\n Shell: 5.9 - /usr/bin/zsh\r\n Binaries:\r\n Node: 18.13.0 - /usr/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 9.2.0 - /usr/bin/npm\r\n Browsers:\r\n Chrome: 116.0.5845.179\r\n npmPackages:\r\n vitepress: ^1.0.0-rc.10 => 1.0.0-rc.10\r\n```\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2865,2868,2871],{"name":2866,"color":2867},"theme","0754FB",{"name":2869,"color":2870},"a11y","fbca04",{"name":2872,"color":2873},"stale","ededed",2930,"vuejs","vitepress","open","themeConfig.socialLinks.icon ","2024-02-02T09:23:16Z","https://github.com/vuejs/vitepress/issues/2930",0.7743003,{"description":2883,"labels":2884,"number":2889,"owner":2875,"repository":2876,"state":2877,"title":2890,"updated_at":2891,"url":2892,"score":2893},"### Describe the bug\r\n\r\nThe theme docs and code completion state that the `router` instance is exposed in `enhanceApp()` but it appears the `router` instance is actually a `route` instance, and doesn't conform to the [Router](https://vitepress.dev/reference/runtime-api#userouter) interface.\r\n\r\n\r\n\r\n\r\n### Reproduction\r\n\r\nInitialize a new project, then add the following code to `enhanceApp()`:\r\n\r\n```ts\r\n console.log({ router })\r\n router.onAfterRouteChanged((to: string) => {\r\n console.log(`changed to: ${to}`)\r\n })\r\n```\r\n\r\n### Expected behavior\r\n\r\nWe should be able to interact with the `router` instance\r\n\r\n### System Info\r\n\r\n```Text\r\nSystem:\r\n OS: macOS 14.5\r\n CPU: (12) arm64 Apple M3 Pro\r\n Memory: 213.02 MB / 36.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.15.1 - /usr/local/bin/node\r\n Yarn: 1.22.22 - /usr/local/bin/yarn\r\n npm: 10.7.0 - /usr/local/bin/npm\r\n pnpm: 8.15.6 - /usr/local/bin/pnpm\r\n Browsers:\r\n Brave Browser: 122.1.63.169\r\n Chrome: 128.0.6613.138\r\n Chrome Canary: 130.0.6720.0\r\n Edge: 128.0.2739.79\r\n Safari: 17.5\r\n npmPackages:\r\n vitepress: ^1.3.4 => 1.3.4\r\n```\r\n\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Validations\r\n\r\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\r\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.dev).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2885,2888],{"name":2886,"color":2887},"docs","0075ca",{"name":2872,"color":2873},4204,"`enhanceApp()` `ctx.router` is not a router instance","2024-10-26T17:17:21Z","https://github.com/vuejs/vitepress/issues/4204",0.7865537,{"description":2895,"labels":2896,"number":2898,"owner":2875,"repository":2876,"state":2877,"title":2899,"updated_at":2900,"url":2901,"score":2902},"### Describe the bug\n\nI'm using vitepress's nodejs api, but one problem is that if I call build twice, the second time there will be the wrong cache, causing the built index.html to still be the old result from the first time.\r\n\r\n```ts\r\nimport { mkdir, readFile, writeFile } from 'fs/promises'\r\nimport path from 'path'\r\nimport { build } from 'vitepress'\r\nimport { it, expect } from 'vitest'\r\n\r\nconst tempPath = path.resolve(__dirname, '.temp')\r\n\r\nit('should build', async () => {\r\n await mkdir(tempPath, { recursive: true })\r\n await writeFile(path.resolve(tempPath, 'index.md'), '# test 1')\r\n await build(tempPath, {\r\n outDir: path.resolve(tempPath, 'dist'),\r\n })\r\n expect(\r\n await readFile(path.resolve(tempPath, 'dist/index.html'), 'utf-8'),\r\n ).include('test 1')\r\n await writeFile(path.resolve(tempPath, 'index.md'), '# test 2')\r\n await build(tempPath, {\r\n outDir: path.resolve(tempPath, 'dist'),\r\n })\r\n expect(\r\n await readFile(path.resolve(tempPath, 'dist/index.html'), 'utf-8'),\r\n ).include('test 2') // AssertionError: expected '\u003C!DOCTYPE html>\\n\u003Chtml lang=\"en-US\" d…' to include 'test 2'\r\n})\r\n```\n\n### Reproduction\n\n1. `git clone https://github.com/rxliuli/vitepress-error-demo`\r\n2. `pnpm i`\r\n3. `pnpm vitest`\n\n### Expected behavior\n\nThe cache should be cleared during the second build\n\n### System Info\n\n```Text\nSystem:\r\n OS: macOS 13.3\r\n CPU: (12) arm64 Apple M2 Max\r\n Memory: 10.56 GB / 64.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.10.0 - /usr/local/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 10.2.3 - /usr/local/bin/npm\r\n pnpm: 8.12.1 - /usr/local/bin/pnpm\r\n Watchman: 2023.08.14.00 - /opt/homebrew/bin/watchman\r\n Browsers:\r\n Brave Browser: 115.1.56.11\r\n Chrome: 120.0.6099.109\r\n Safari: 16.4\r\n npmPackages:\r\n vitepress: 1.0.0-rc.32 => 1.0.0-rc.32\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2897],{"name":2872,"color":2873},3363,"bug: Repeated builds will result in incorrect cache","2025-03-02T18:10:05Z","https://github.com/vuejs/vitepress/issues/3363",0.795295,{"description":2904,"labels":2905,"number":2909,"owner":2875,"repository":2876,"state":2910,"title":2911,"updated_at":2912,"url":2913,"score":2914},"### Is your feature request related to a problem? Please describe.\n\nCurrent user's config in the markdown option is loaded after all pre-defined plugins. This enables use to do some initial works for other plugins but not able to hook their results.\n\n### Describe the solution you'd like\n\nI would like to have `configAfter` and `configBefore` two different options to load my own markdown-it plugin.\n\n### Describe alternatives you've considered\n\n_No response_\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2906],{"name":2907,"color":2908},"build","377ba8",1382,"closed","Allow custom markdown-it plugin to be loaded first","2023-08-12T00:04:16Z","https://github.com/vuejs/vitepress/issues/1382",0.75359774,{"description":2916,"labels":2917,"number":2918,"owner":2875,"repository":2876,"state":2910,"title":2919,"updated_at":2920,"url":2921,"score":2922},"### Is your feature request related to a problem? Please describe.\n\n\r\n\n\n### Describe the solution you'd like\n\n1\n\n### Describe alternatives you've considered\n\n_No response_\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.dev).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],2511,"I want to add a icon to the sidebar,like this picuture,how should I do ?","2023-06-25T00:05:06Z","https://github.com/vuejs/vitepress/issues/2511",0.7645264,{"description":2924,"labels":2925,"number":2927,"owner":2875,"repository":2876,"state":2910,"title":2928,"updated_at":2929,"url":2930,"score":2931},"### Is your feature request related to a problem? Please describe.\n\nI want user `h1` as my article outline, i can't use theme config to custom my outline\n\n### Describe the solution you'd like\n\nif i have config in my config.js\r\n```js\r\n themeConfig: {\r\n outline: [1,6] || 'all'\r\n}\r\n```\r\nthe title selector should like this\r\n```js\r\ndocument\r\n .querySelectorAll\u003CHTMLHeadingElement>('h1,h2, h3, h4, h5, h6') // include h1 title\r\n .forEach((el) => {\r\n if (el.textContent && el.id) {\r\n updatedHeaders.push({\r\n level: Number(el.tagName[1]),\r\n title: el.innerText.replace(/\\s+#\\s*$/, ''),\r\n link: `#${el.id}`\r\n })\r\n }\r\n })\r\n```\n\n### Describe alternatives you've considered\n\n_No response_\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[2926],{"name":2866,"color":2867},1529,"The levels of header to display in the outline can't support h1 title","2023-08-12T00:04:14Z","https://github.com/vuejs/vitepress/issues/1529",0.76721686,{"description":2933,"labels":2934,"number":2935,"owner":2875,"repository":2876,"state":2910,"title":2936,"updated_at":2937,"url":2938,"score":2939},"Hi,\r\n\r\nI was looking at this plugin https://github.com/davay42/vitepress-tags which mentions using `customData` property in config.js\r\n\r\n```js\r\nexport default {\r\n title: \"site\",\r\n themeConfig: {...},\r\n customData: {\r\n key: {...}\r\n }\r\n}\r\n```\r\n\r\nAnd the values can be accessed from `$site.customData.key` in markdowns, for example.\r\n\r\nFrom my understanding, the `$site` API has been replaced by `useData()`, but I don't see `customData` in the returned object when using `useData()`, nor to see it is mentioned in the current documentation.\r\n\r\nSo here's my question: is `customData` expected to be returned? Or is it removed along with `$site`?",[],1650,"Does useData() return `customData` from config.js?","2023-03-29T00:04:12Z","https://github.com/vuejs/vitepress/issues/1650",0.7730468,{"description":2941,"labels":2942,"number":2943,"owner":2875,"repository":2876,"state":2910,"title":2944,"updated_at":2945,"url":2946,"score":2947},"### Is your feature request related to a problem? Please describe.\n\n我想要通过一些控制语句实现`markdown`文档的快速编写,比如这样:\r\n```html\r\n// XXX.md\r\n---\r\nsidebar: false\r\n---\r\n\u003Cscript setup>\r\nimport { beijing } from '../const/imgLink.ts'\r\n\u003C/script>\r\n# 标题一 \r\n\r\n\u003Cdiv v-for='item in beijing'>\r\n ## {{item[0].title}}\r\n \u003Cmany-pictures :srcImgs='item' :lazy='true' />\r\n\u003C/div>\r\n```\r\n但显然`# 标题一 `可以被成功渲染为标题,而`## {{item[0].title}}`却只能是纯文本,因为这部分根本不会经过`markdown`渲染器的渲染。\n\n### Describe the solution you'd like\n\n我理解是否可以添加一个标识,比如:\r\n```js\r\n\u003Cdiv v-for='item in beijing'>\r\n ## {{item[0].title}}\r\n ::: markdown-block\r\n ## title\r\n // content\r\n ::: \r\n \u003Cmany-pictures :srcImgs='item' :lazy='true' />\r\n\u003C/div>\r\n\r\n```\r\n然后预期中这个块会被`markdown`渲染器渲染之后再交给`vue`相关的编译器去解析。\r\n如果可以支持这个功能,结合`vue`中的`v-if/v-for`等条件控制语句,可以帮助我实现许多页面的快速编写\n\n### Describe alternatives you've considered\n\n目前我只能直接在`v-for`语句中编写纯`html`语法的内容,这对于我来说有一定的心智负担,还是以上述的例子来说,这是我目前的替代方案:\r\n```html\r\n---\r\nsidebar: false\r\n---\r\n\u003Cscript setup>\r\nimport { beijing } from '../const/imgLink.ts'\r\n\u003C/script>\r\n# 标题一\r\n\u003Cdiv v-for='item in beijing'>\r\n \u003Ch2 :id=\"item[0].title\" tabindex=\"-1\">\r\n {{item[0].title}}\r\n \u003Ca class=\"header-anchor\" :href=\"`#${item[0].title}`\" aria-hidden=\"true\">#\u003C/a>\r\n \u003C/h2>\r\n \u003Cmany-pictures :srcImgs='item' :lazy='true' />\r\n\u003C/div>\r\n```\n\n### Additional context\n\n我也许可以尝试实现该功能\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [X] Read the [docs](https://vitepress.vuejs.org).\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[],1570,"在模板语法或标签语法中,是否可以增加一个类似块一样的标识,以至于块中的内容可以被`markdown`解析器识别并渲染为`html`","2023-01-21T14:20:46Z","https://github.com/vuejs/vitepress/issues/1570",0.7733096,{"description":2949,"labels":2950,"number":2955,"owner":2875,"repository":2876,"state":2910,"title":2956,"updated_at":2957,"url":2958,"score":2959},"### Describe the bug\n\nIn alpha 3, when using code block language aliases, I receive this error: `The language 'my-lang-alias' is not loaded, falling back to 'txt' for syntax highlighting.`\n\nAliases worked correctly in alpha 2.\n\n### Reproduction\n\nStackBlitz repro here (code block is on the **Get Started** page):\n\n[https://stackblitz.com/edit/vite-eswufd7t?file=docs%2Fexample.md](https://stackblitz.com/edit/vite-eswufd7t?file=docs%2Fexample.md)\n\n### Expected behavior\n\nLanguage aliased added to **defineConfig** > **markdown** > **languageAlias** are available as code block languages.\n\n### System Info\n\n```Text\nSystem:\n OS: Linux 5.15 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)\n CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700T\n Memory: 23.13 GB / 31.19 GB\n Container: Yes\n Shell: 5.2.21 - /bin/bash\n Binaries:\n Node: 22.13.0 - /usr/bin/node\n npm: 10.9.2 - /usr/bin/npm\n pnpm: 9.6.0 - /usr/bin/pnpm\n npmPackages:\n vitepress: ^2.0.0-alpha.3 => 2.0.0-alpha.3\n```\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [x] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).\n- [x] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\n- [x] Read the [docs](https://vitepress.dev).\n- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[2951,2952],{"name":2907,"color":2908},{"name":2953,"color":2954},"upstream","BF29ED",4581,"languageAlias broken in 2.0.0-alpha.3","2025-03-06T04:44:32Z","https://github.com/vuejs/vitepress/issues/4581",0.78245705,{"description":2961,"labels":2962,"number":2963,"owner":2875,"repository":2876,"state":2910,"title":2964,"updated_at":2965,"url":2966,"score":2967},"As shown in the picture, the icon is not displayed normally. How to configure it?\r\n",[],2920," Regarding the display problem of ‘favicon’","2023-09-16T00:04:03Z","https://github.com/vuejs/vitepress/issues/2920",0.78699875,["Reactive",2969],{},["Set"],["ShallowReactive",2972],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f4UqWDo2j2Gsy_uZNJbK3HuuAbq1PYHPiB8PEfoT2Occ":-1},"/vuejs/vitepress/1088"]