\r\n```\r\n\r\n```\r\n// test-2.md\r\n---\r\ntitle: ❌\r\n---\r\n\r\n\u003Cscript setup lang=\"ts\">\r\nimport { ref } from \"vue\";\r\nimport yaml from \"yaml\";\r\nimport \"uno.css\";\r\n\u003C/script>\r\n\r\n\u003CTestInfo />\r\n```\r\n\r\n```\r\n// test-3.md\r\n---\r\ntitle: ❌\r\n---\r\n\r\n\u003Cscript setup lang=\"ts\">\r\nconst data = 123;\r\n\u003C/script>\r\n\r\n\u003CTestInfo />\r\n\r\n```\r\n\r\nWhen I execute `pnpm dev`(`vitepress dev website`), accessing `/test-1`, `/test-2`, `/test-3` works fine.\r\n\r\nWhen I execute `pnpm build && pnpm preview`(`vue-tsc && vitepress build website && vitepress preview website`), visit `/test-1`, `/test-2`, `/test-3`, my custom component does not work properly and the F12 console reports `Hydration completed but contains mismatches.`.\r\n\r\n\r\n\r\n### Expected behavior\r\n\r\nWhen I add the valid `\u003Cscript>` and execute `vue-tsc && vitepress build website && vitepress preview website`, the custom components will display normally and the console will not report an error.\r\n\r\n### System Info\r\n\r\n```shell\r\nSystem:\r\n OS: Windows 10 10.0.22000\r\n CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12500H\r\n Memory: 1.13 GB / 15.73 GB\r\n Binaries:\r\n Node: 16.17.1 - C:\\Program Files\\nodejs\\node.EXE\r\n Yarn: 1.22.19 - ~\\AppData\\Roaming\\npm\\yarn.CMD\r\n npm: 8.15.0 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22000.120.0), Chromium (109.0.1518.78)\r\n Internet Explorer: 11.0.22000.120\r\n npmPackages:\r\n vitepress: 1.0.0-alpha.32 => 1.0.0-alpha.32\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] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.vuejs.org).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[3084,3085],{"name":3073,"color":3074},{"name":3024,"color":3025},1918,"Warn `Hydration completed but contains mismatches.` and Custom components are not rendered","2023-08-11T00:04:12Z","https://github.com/vuejs/vitepress/issues/1918",0.7072262,{"description":3092,"labels":3093,"number":3094,"owner":3027,"repository":3028,"state":3076,"title":3095,"updated_at":3096,"url":3097,"score":3098},"### Describe the bug\n\nWhen using custom children in the `\u003Cbadge>` component, it breaks the `outlineBadges: false` option and will display the badge's text in the sidebar outline.\n\n### Reproduction\n\n1. Add a badge to an H2 title (##)\r\n2. Add custom children in the badge slot\r\n3. Set `outlineBadges` option to `false`\r\n\r\nhttps://stackblitz.com/edit/vite-smtupz?file=docs/example.md\n\n### Expected behavior\n\n`outlineBadges` honors badges with custom children/elements when set to false.\n\n### System Info\n\n```shell\nSystem:\r\n OS: Windows 10 10.0.22621\r\n CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor\r\n Memory: 18.43 GB / 31.93 GB\r\n Binaries:\r\n Node: 18.12.0 - C:\\Program Files\\nodejs\\node.EXE\r\n npm: 9.2.0 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.22621.1344.0), Chromium (110.0.1587.63)\r\n Internet Explorer: 11.0.22621.1\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.50 => 1.0.0-alpha.50\n```\n\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] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[],2060,"Badge slot breaks `outlineBadges`","2023-03-19T00:04:50Z","https://github.com/vuejs/vitepress/issues/2060",0.72034824,{"description":3100,"labels":3101,"number":3103,"owner":3027,"repository":3028,"state":3076,"title":3104,"updated_at":3105,"url":3106,"score":3107},"### Describe the bug\n\n# 问题描述\r\n根据官方文档的描述,如果每个文档页面中的frontmatter没有设置上下页链接,它会根据sidebar侧边栏推断出上下页跳转,在[我的项目](https://i-am-shy.github.io/vitepress/)中,仅仅只是添加了几个文档页面(都是默认最简单的配置并没有使用自定义主题)\r\n\r\n\r\n**错误展示**\r\n\r\n在这个页面(包括后续的页面,它们都被定向到了第一个文档的位置)中没有正确的按照侧边栏推断出上下页\r\n\r\n\r\n\r\n[这里](https://github.com/I-am-shy/vitepress/blob/main/docs/JS/Animation/index.md)查看这个页面的md代码\r\n\r\n\r\n\n\n### Reproduction\n\n可以查看我在github部署的[项目](https://i-am-shy.github.io/vitepress/)\r\n\r\n---\r\n在每个文档页中都是普通的md,并没有设置frontmatter 配置相关的内容\r\n\r\n这是我的config.mts:\r\n```js\r\nimport { defineConfig } from 'vitepress'\r\n\r\n// https://vitepress.dev/reference/site-config\r\nexport default defineConfig({\r\n lang: 'zh-CN',\r\n base: '/vitepress/',\r\n title: \"shy的学习笔记\",\r\n description: \"一个文档网站\",\r\n lastUpdated: true,\r\n head:[\r\n ['link',{ rel: 'icon', href: '/vitepress/favicon.ico' }]\r\n ],\r\n themeConfig: {\r\n // https://vitepress.dev/reference/default-theme-config\r\n nav: [\r\n { text: '主页', link: '/' },\r\n { text: 'md语法', link: '/markdown-examples' },\r\n ],\r\n\r\n sidebar: [\r\n {\r\n text: 'md语法',\r\n items: [\r\n { text: 'Markdown 例子', link: '/markdown-examples' },\r\n { text: '运行时 API 例子', link: '/api-examples' }\r\n ],\r\n collapsed: false\r\n },\r\n {\r\n text: \"JS\",\r\n items:[\r\n {\r\n text: \"浏览器API\",\r\n items: [\r\n { text: \"js实现拍摄和录屏功能\", link: \"/JS/Video\"}\r\n ],\r\n collapsed: true\r\n }, \r\n {\r\n text: \"js动画库\",\r\n items: [\r\n {text: \"popmotion\", link: \"/JS/Animation\"}\r\n ],\r\n collapsed: true\r\n },\r\n {\r\n text: \"ThreeJS 3D模型\",\r\n items:[\r\n { text: \"基本概念\", link: \"/JS/ThreeJS\"},\r\n { text: \"初始化场景模型\", link: \"/JS/ThreeJS/init\"},\r\n { text: \"第一个3D场景模型\", link:\"/JS/ThreeJS/scene\"},\r\n { text: \"几何矩阵\" , link:\"/JS/ThreeJS/geometry\"},\r\n ],\r\n collapsed: true\r\n },\r\n { text: \"js爬虫\", link: \"/JS/Clawler\" },\r\n { text: \"js流\", link: \"/JS/Stream\"},\r\n { text: \"http-server\",link: \"/JS/http-server\"},\r\n { text: \"html转markdown\", link: \"/JS/Turndown\"},\r\n { text: \"2d物理引擎\", link: \"/JS/Matter\"},\r\n ],\r\n collapsed: false\r\n },\r\n {\r\n text: \"TS\",\r\n items:[\r\n {text: \"在任意位置运行ts\", link: \"/TS/run-TS\"}\r\n ],\r\n collapsed: false\r\n },\r\n {\r\n text: \"其他\",\r\n items:[\r\n {text: \"YAML\", link: \"/other/yaml\"}\r\n ],\r\n collapsed: false\r\n }\r\n ],\r\n\r\n socialLinks: [\r\n { icon: 'github', link: 'https://github.com/I-am-shy/vitepress' }\r\n ],\r\n\r\n search: {\r\n provider: 'local'\r\n },\r\n\r\n lastUpdated:{\r\n text: '最后更新时间',\r\n formatOptions: {\r\n dateStyle: 'short',\r\n timeStyle: 'short'\r\n }\r\n },\r\n\r\n\r\n }\r\n})\r\n```\n\n### Expected behavior\n\n自动推断可以在后续的文档项目中减少工作量,希望可以修复这个问题,或者指出我在项目中错误的代码部分,万分感谢😥😥😥\n\n### System Info\n\n```Text\nSystem:\r\n OS: macOS 15.0.1\r\n CPU: (8) arm64 Apple M1\r\n Memory: 136.16 MB / 8.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 20.17.0 - /usr/local/bin/node\r\n npm: 10.8.2 - /usr/local/bin/npm\r\n Browsers:\r\n Chrome: 131.0.6778.87\r\n Edge: 131.0.2903.70\r\n Safari: 18.0.1\r\n npmPackages:\r\n vitepress: ^1.5.0 => 1.5.0\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.",[3102],{"name":3073,"color":3074},4403,"上下页的自动推断功能异常","2024-12-12T04:45:57Z","https://github.com/vuejs/vitepress/issues/4403",0.741146,{"description":3109,"labels":3110,"number":3112,"owner":3027,"repository":3028,"state":3076,"title":3113,"updated_at":3114,"url":3115,"score":3116},"### Describe the bug\r\n\r\nIn Makrdown code snippets new lines are now being ignored. You need to manually add `\u003Cspace>` with a newline to render it in the docs\r\n\r\n### Reproduction\r\n\r\nCreate a code snippet which has new lines\r\n\r\n### Expected behavior\r\n\r\nShould render new lines without additional steps\r\n\r\n### System Info\r\n\r\n```shell\r\n System:\r\n OS: Windows 10 10.0.19044\r\n CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz \r\n Memory: 6.91 GB / 15.96 GB\r\n Binaries:\r\n Node: 16.13.0 - C:\\Program Files\\nodejs\\node.EXE \r\n Yarn: 1.22.0 - C:\\Program Files (x86)\\Yarn\\bin\\yarn.CMD\r\n npm: 8.1.0 - C:\\Program Files\\nodejs\\npm.CMD\r\n Browsers:\r\n Chrome: 104.0.5112.81\r\n Edge: Spartan (44.19041.1266.0), Chromium (104.0.1293.54)\r\n Internet Explorer: 11.0.19041.1566\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.5 => 1.0.0-alpha.5\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] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)\r\n- [X] Read the [docs](https://vitepress.vuejs.org).\r\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[3111],{"name":3021,"color":3022},1175,"New lines are ignored in markdown code snippets in 1.0.0-alpha.5","2023-01-21T14:28:43Z","https://github.com/vuejs/vitepress/issues/1175",0.7490436,{"description":3118,"labels":3119,"number":3126,"owner":3027,"repository":3028,"state":3076,"title":3127,"updated_at":3128,"url":3129,"score":3130},"### Is your feature request related to a problem? Please describe.\n\n可以看到如果是js类型那么下面的方式颜色差异效果是有的\n```js\nexport default {\n data () {\n return {\n msg: 'Removed' // [!code --]\n msg: 'Added' // [!code ++]\n }\n }\n}\n```\n\n像这种text文本类型就无法让颜色差异效果显示出来\n\n```text\n\u003CSidebar collapsible=\"icon\" variant=\"sidebar\"> // [!code --]\n\u003CSidebar collapsible=\"icon\" variant=\"inset\"> // [!code ++]\n```\n\n我知道不同的语法它的注释方式不同, 也许是 `//`、`#` ,但是,现在我确实有这个需求了,我想让纯文本类型也能显示颜色差异效果,我觉得这个可以加入到vitepress的新特性中,然后发布一个小版本。\n\n\n### Describe the solution you'd like\n\n我的解决方案是这样的,如果没有注释符号,只要在代码块的行尾出现`[!code --]`和`[!code ++]` 那么就应该让效果生效\n\n```text\n\u003CSidebar collapsible=\"icon\" variant=\"sidebar\"> [!code --]\n\u003CSidebar collapsible=\"icon\" variant=\"inset\"> [!code ++]\n```\n\n\n因为比较着急,是否有临时解决方案呢?将不胜感激\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.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.",[3120,3123],{"name":3121,"color":3122},"has-workaround","1B4515",{"name":3124,"color":3125},"upstream","BF29ED",4602,"代码块的类型如果是text类型,那么颜色差异差异无效","2025-03-17T04:44:42Z","https://github.com/vuejs/vitepress/issues/4602",0.7592815,["Reactive",3132],{},["Set"],["ShallowReactive",3135],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$ffkuBAxKjh4guPQfNO8u2acA0Ueh0D-rk2blzvGpKFow":-1},"/vuejs/vitepress/1897"]