\r\n\u003C/div>\r\n`\r\n\r\n// when creating a demo section, `@/` will be replaced with `srcDir`\r\nexport const demoPlugin = (md: MarkdownIt, srcDir: string) => {\r\n const parser: RuleBlock = (state, startLine, _endLine, _silent) => {\r\n /*... some code to extract the file name from the markdown ... */\r\n token.attrSet('src', resolve(filename))\r\n return true\r\n }\r\n\r\n const renderer: RenderRule = (...args) => {\r\n /* ... some code to get `src` and check that the file exists ... */\r\n \r\n const file = readFileSync(src, 'utf8')\r\n\r\n // script\r\n token.info = `ts`\r\n token.content = findSection(file, SCRIPT_START, SCRIPT_END)\r\n const script = md.renderer.rules.fence!(...args)\r\n\r\n // template\r\n token.info = `vue-html`\r\n token.content = findSection(file, TEMPLATE_START, TEMPLATE_END)\r\n const template = md.renderer.rules.fence!(...args)\r\n\r\n // component\r\n const demo = md.render(COMPONENT_SNIPPET(src))\r\n\r\n return script + template + demo\r\n }\r\n\r\n md.renderer.rules.demo = renderer\r\n md.block.ruler.before(md.block.ruler.getRules('')[0].name, 'demo', parser)\r\n}\r\n\r\n// returns everything between the first match of `start` and the subsequent first match for `end`\r\nfunction findSection(content: string, start: RegExp, end: RegExp): string {\r\n //...\r\n}\r\n``` \r\n\r\nSo the markdown rendered used to take the line `const demo = md.render(COMPONENT_SNIPPET(src))` and automagically put the `import` statement where it needs to be and happily render the component. However, since updating to `1.0.0-alpha.11` this no longer works. In fact if I manually write out the import statement in the markdown file, everything works - so something is wrong with the way my plugin is handling the import.\r\n\r\nI looked into the way [plugin-sfc](https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-sfc) works and it looks like there was a change from `0.10.0` to `0.11.0` in the way script SFC blocks are handled.\r\n\r\nI tried to copy the way the changed code works in my plugin, but I have not managed to get it working:\r\n\r\n```ts\r\n const block = `\u003Cscript setup lang=\"ts\"> import DemoComponent from \"${src}\"; \u003C/script>`\r\n sfcBlocks.scriptSetup = block\r\n sfcBlocks.scripts.push(block)\r\n\r\n token.content = `\u003Cdiv class=\"vp-raw\"> \u003Cdemo-component/> \u003C/div>`\r\n const demo = md.renderer.rules.html_block!(...args)\r\n```\r\n\r\nDoes anyone know how this can be done? How can my plugin tell VitePress that it needs to import the demo component for this page?\r\n",[],1349,"closed","Import custom component in MarkdownIt plugin","2023-01-21T14:22:46Z","https://github.com/vuejs/vitepress/issues/1349",0.6791712,{"description":3090,"labels":3091,"number":3095,"owner":3027,"repository":3028,"state":3084,"title":3096,"updated_at":3097,"url":3098,"score":3099},"### Describe the bug\n\nThis is not working as intended.\r\n\r\n\r\n\r\n[StackBlitz](https://vitepress.new/)\r\n\r\nWhen you click, it will take you here, and the side terminal will show \"installing dependencies.\"\r\n\r\n\r\n\r\nBut after a few seconds, it crashes.\r\n\r\n\r\n\r\nI checked it with other browsers as well, but the same thing is happening.\n\n### Reproduction\n\nSimply go to this link [StackBlitz](https://vitepress.new/).\r\n\r\nAnd wait for few seconds.\r\n\r\n\r\n \n\n### Expected behavior\n\nIt should not crash.\n\n### System Info\n\n```sh\nSystem:\r\n OS: Linux 5.0 undefined\r\n CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz\r\n Memory: 0 Bytes / 0 Bytes\r\n Shell: 1.0 - /bin/jsh\r\nBinaries:\r\n Node: 16.20.0 - /usr/local/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 9.4.2 - /usr/local/bin/npm\r\n pnpm: 8.6.10 - /usr/local/bin/pnpm\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.",[3092],{"name":3093,"color":3094},"upstream","BF29ED",2838,"starter template is crashing.","2023-09-01T00:04:33Z","https://github.com/vuejs/vitepress/issues/2838",0.7024405,{"description":3101,"labels":3102,"number":3103,"owner":3027,"repository":3028,"state":3084,"title":3104,"updated_at":3105,"url":3106,"score":3107},"### Describe the bug\n\n当我按顺序引入js脚本的时候,后面的脚本依赖于前面的,问题入下图\n\n### Reproduction\n\nhttps://stackblitz.com/edit/vite-yl3bnx\n\n### Expected behavior\n\n预期是不会产生 is not defined. 这个错误\n\n### System Info\n\n```Text\nSystem:\r\n OS: macOS 12.3.1\r\n CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz\r\n Memory: 147.43 MB / 16.00 GB\r\n Shell: 3.2.57 - /bin/sh\r\n Binaries:\r\n Node: 20.0.0 - /usr/local/bin/node\r\n Yarn: 1.22.19 - /usr/local/bin/yarn\r\n npm: 9.6.4 - /usr/local/bin/npm\r\n Browsers:\r\n Chrome: 117.0.5938.62\r\n Safari: 15.4\r\n npmPackages:\r\n vitepress: ^1.0.0-rc.13 => 1.0.0-rc.13\n```\n\n\n### Additional context\n\n\u003Cimg width=\"521\" alt=\"image\" src=\"https://github.com/vuejs/vitepress/assets/17758990/61b1827b-79f7-4b89-8db4-29061ba08a02\">\r\n\u003Cimg width=\"649\" alt=\"image\" src=\"https://github.com/vuejs/vitepress/assets/17758990/4757b2c1-35b6-4336-bd4a-f9731418dc82\">\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.",[],2966,"head 引入脚本提示未定义","2023-09-23T00:04:04Z","https://github.com/vuejs/vitepress/issues/2966",0.7169387,{"description":3109,"labels":3110,"number":3114,"owner":3027,"repository":3028,"state":3084,"title":3115,"updated_at":3116,"url":3117,"score":3118},"### Describe the bug\n\nExecute command npm run docs:build and throw an exception: build error:\r\nTypeError: Intl.Segmenter is not a constructor\r\n\n\n### Reproduction\n\n.vitepress config.ts\r\n```\r\nimport { defineConfig } from 'vitepress'\r\n\r\nexport default defineConfig({\r\n lang: 'en-US',\r\n lastUpdated: true,\r\n cleanUrls: true,\r\n\r\n themeConfig: {\r\n\r\n nav: nav(),\r\n\r\n sidebar: {\r\n '/rest-api/': sidebarRestApi(),\r\n }\r\n }\r\n})\r\n```\r\n\r\npackage.json\r\n```\r\n\"scripts\": {\r\n \"dev:docs\": \"npx vitepress dev docs\",\r\n \"build:docs\": \"npx vitepress build docs\",\r\n \"serve:docs\": \"npx vitepress serve docs\"\r\n },\r\n \"dependencies\": {\r\n \"vue\": \"^3.3.4\"\r\n },\r\n \"devDependencies\": {\r\n \"vitepress\": \"^1.0.0-rc.4\"\r\n }\r\n```\n\n### Expected behavior\n\nnpm run build:docs\n\n### System Info\n\n```sh\nnpx vitepress build docs\r\n\r\nvitepress v1.0.0-rc.4\r\n\r\nbuild error:\r\nTypeError: Intl.Segmenter is not a constructor\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.",[3111],{"name":3112,"color":3113},"need more info","bdbefc",2817,"Vitepress build error","2023-08-27T00:06:17Z","https://github.com/vuejs/vitepress/issues/2817",0.7327866,{"description":3120,"labels":3121,"number":3123,"owner":3027,"repository":3028,"state":3084,"title":3124,"updated_at":3125,"url":3126,"score":3127},"### Is your feature request related to a problem? Please describe.\r\n\r\nWe recently migrated our site https://grammy.dev from VuePress 2 to VitePress, and we adjusted the configuration for the Algolia crawler according to their example at https://docsearch.algolia.com/docs/templates/#vitepress-template. However, this config yields almost 60 % fewer records for the search index in comparison with the VuePress config on the old VuePress site.\r\n\r\n### Describe the solution you'd like\r\n\r\nPublish the config you use for the Algolia crawler, or publish a different example config. Ideally, it should be included here: https://vitepress.dev/reference/default-theme-search#algolia-search\r\n\r\n### Describe alternatives you've considered\r\n\r\nWait for Algolia to update their docs, which I am not sure when it will happen. VitePress moves quickly, and I am not sure how well they are able to keep up with their docs. You guys know your site best, so it will be helpful to have a VitePress-recommended crawler config.\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.dev).\r\n- [X] Read the [Contributing Guidelines](https://github.com/vuejs/vitepress/blob/main/.github/contributing.md).\r\n- [X] Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.",[3122],{"name":3021,"color":3022},2592,"Provide example Algolia crawler configuration in the docs","2023-07-27T00:04:26Z","https://github.com/vuejs/vitepress/issues/2592",0.74092567,["Reactive",3129],{},["Set"],["ShallowReactive",3132],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fBySDeHCRG-Hd6F1S0PC9_N8DwoRLNakOz2LEgfKys2c":-1},"/vuejs/vitepress/2203"]