(\\s*[^\\\u003C\\>]*\\s*)\\\u003C\\/label\\>/g, (_, $1) => {\r\n return `>${getLogoTagString($1)} ${$1}\u003C/label>`\r\n })\r\n }\r\n}\r\n\r\nexport default langPlugin\r\n\r\n```\n\n### Describe the solution you'd like\n\n```diff\r\n- import MarkdownIt from 'markdown-it';\r\n+ import type { MarkdownIt } from 'vitepress'\r\nimport { getLogoTagString } from '../content'\r\n\r\nfunction langPlugin(md: MarkdownIt) {\r\n const temp = md.renderer!.rules!.fence!.bind(md.renderer.rules)\r\n md.renderer.rules.fence = (tokens, idx, options, env, slf) => {\r\n const token = tokens[idx]\r\n if (getLogoTagString(token.info)) {\r\n const result = token.info.match(/^\\b([\\w\\.]*)\\b/)\r\n if (!result)\r\n return temp(tokens, idx, options, env, slf)\r\n const [_, lang] = result\r\n const content = temp(tokens, idx, options, env, slf)\r\n const value = getLogoTagString(lang)\r\n return content.replace(`\u003Cspan class=\"lang\">${lang}\u003C/span>`, `\u003Cspan class=\"lang icon\">${value}\u003C/span>`)\r\n }\r\n\r\n return temp(tokens, idx, options, env, slf)\r\n }\r\n\r\n // insert icon before\r\n // https://github.com/vuejs/vitepress/blob/0c434bf537a64b06fc0bc630b4ee58b9fa67309b/src/node/markdown/plugins/containers.ts#L95\r\n const rawCodeGroupRender = md.renderer.rules['container_code-group_open']!\r\n \r\n md.renderer.rules['container_code-group_open'] = (tokens, idx, options, env, slf) => {\r\n const content: string = rawCodeGroupRender(tokens, idx, options, env, slf)\r\n // match: >index.ts\u003C/label>\r\n return content.replace(/>(\\s*[^\\\u003C\\>]*\\s*)\\\u003C\\/label\\>/g, (_, $1) => {\r\n return `>${getLogoTagString($1)} ${$1}\u003C/label>`\r\n })\r\n }\r\n}\r\n\r\nexport default langPlugin\r\n\r\n```\n\n### Describe alternatives you've considered\n\nNot yet.\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.",[],4146,"closed","Support exporting in `MarkdownIt` interface to be compatible with Markdown plugins users have written themselves","2024-08-25T04:42:06Z","https://github.com/vuejs/vitepress/issues/4146",0.691319,{"description":2954,"labels":2955,"number":2956,"owner":2874,"repository":2875,"state":2948,"title":2957,"updated_at":2958,"url":2959,"score":2960},"### Is your feature request related to a problem? Please describe.\r\n\r\nYes, the default theme has a built-in local search, while it's importing `dataSymbol`, which is private and not accessable outside vitepress.\r\n\r\nhttps://github.com/vuejs/vitepress/blob/80e734d67763fea449647b7b21dfde0bde1c360b/src/client/theme-default/components/VPLocalSearchBox.vue#L30\r\n\r\nBy importing this symbol, the built-in local search achieves \"mocking pageData in another app instance\" and render other page as components.\r\n\r\nThis is unfair for third party themes, as they do not have same ability to this tricky job and provide a similar built-in theme.\r\n\r\n### Describe the solution you'd like\r\n\r\nExport this symbol or stop using it. The default theme should not access vitepress private apis to \"provide magic\". Everything should work outside vitepress in order not to embarrass 3rd party themes.\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\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.",[],2489,"Stop using hacky features in default theme","2023-06-25T00:05:05Z","https://github.com/vuejs/vitepress/issues/2489",0.73016113,{"description":2962,"labels":2963,"number":2967,"owner":2874,"repository":2875,"state":2948,"title":2968,"updated_at":2969,"url":2970,"score":2971},"### Describe the bug\r\n\r\nWhen using the default theme, the navbar items are hidden away in a menu on screen widths lower than 768px.\r\n\r\nAt 768px and slightly larger sizes, the navbar may have to render on one line:\r\n\r\n- The logo and site title\r\n- A search box (when using the `algolia` options)\r\n- Several nav items\r\n- And the \"extra navigation\" button\r\n\r\nWhen the nav items don't fit, their text may wrap, and their extreme `line-height` makes that result particularly bad:\r\n\r\n\u003Cimg width=\"862\" alt=\"Screenshot 2022-09-01 at 23 57 42\" src=\"https://user-images.githubusercontent.com/243601/188020460-7355ef38-ea1e-4d18-b68d-cf7052cb4f9b.png\">\r\n\r\n\r\n### Reproduction\r\n\r\n1. Visit reproduction on StackBlitz: https://stackblitz.com/edit/vitepress-theme-issue-navbarmenulink?file=index.md\r\n2. Resize the preview area to be roughtly 800px wide\r\n\r\n\r\n\r\n### Expected behavior\r\n\r\nThere are two levels of fixes:\r\n\r\n1. Mitigate the breakage when nav items do wrap.\r\n - Nav links should not use the header height as their `line-height` (that's a bad way to do vertical centering of text, for the reason demonstrated in this issue).\r\n - Instead use something like `min-height: var(--vp-nav-height-mobile); line-height: normal;` (plus probably a tad of `padding-block`).\r\n\r\n2. If the nav items still overflow their container, what should happen? Should they be clipped (`overflow: hidden` on the container), or should the container height grow (i.e. the container should be using `min-height` and not `height`)? Clipping might be better to conserve the design, but note that it's a WCAG violation (loss of content).\r\n\r\n3. Prevent this situation altogether:\r\n - One option is to use the mobile layout earlier, e.g. for widths lower than 1000px instead of widths lower than 769px. (This might not be enough for some accessibility use cases, like text-only zoom.)\r\n - Another one is to implement a type of dynamic overflow menu, where all items that don't fit in the navbar are moved to the overflow menu. This requires runtime JS, probably using IntersectionObserver.\r\n\r\n### System Info\r\n\r\n```shell\r\nSystem:\r\n OS: macOS 12.5.1\r\n CPU: (8) arm64 Apple M1\r\n Memory: 98.88 MB / 8.00 GB\r\n Shell: 3.5.1 - /opt/homebrew/bin/fish\r\n Binaries:\r\n Node: 16.17.0 - /opt/homebrew/opt/node@16/bin/node\r\n Yarn: 1.22.19 - /opt/homebrew/bin/yarn\r\n npm: 8.12.1 - ~/.npm-packages/bin/npm\r\n Browsers:\r\n Chrome: 105.0.5195.52\r\n Firefox Nightly: 106.0a1\r\n Safari: 15.6.1\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.13 => 1.0.0-alpha.13\r\n```\r\n\r\n### Additional context\r\n\r\nI can probably do a PR for the line-height part at least.\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.",[2964],{"name":2965,"color":2966},"theme","0754FB",1271,"Nav items overflowing navbar on medium viewports","2023-01-21T14:20:36Z","https://github.com/vuejs/vitepress/issues/1271",0.74499124,{"description":2973,"labels":2974,"number":2976,"owner":2874,"repository":2875,"state":2948,"title":2977,"updated_at":2978,"url":2979,"score":2980},"### Describe the bug\n\n**v1.3.0 手机端嵌套菜单不显示小标题**\r\n**v1.3.0 Mobile Nested Menu Does Not Display Subtitles**\r\n\r\n`NavItem[]`\r\n\r\n```ts\r\nconst navBar: DefaultTheme.NavItem[] = [\r\n {text: '首页', link: '/index'},\r\n //-----------\r\n {\r\n text: '工具集',\r\n items: [\r\n {\r\n text: '工具1',\r\n noIcon:true,\r\n items: [\r\n {text: 'a', link: '/a'},\r\n {text: 'a', link: '/a'},\r\n {text: 'a', link: '/a'},\r\n ]\r\n },\r\n {\r\n text: '工具2',\r\n items: [\r\n {text: 'b', link: '/b'},\r\n {text: 'b', link: '/b'},\r\n {text: 'b', link: '/b'},\r\n ]\r\n }\r\n ]\r\n },\r\n //-----------\r\n {text: '关于我', link: '/about'}\r\n]\r\n```\r\n\r\n\r\n\r\n手机端显示:\r\nMobile display:\r\n\r\n\r\n\r\n电脑端显示:\r\nComputer display:\r\n\r\n\r\n> 当我使用 v1.2.3 时一切正常。\r\n> Everything worked fine when I was using v1.2.3.\r\n\r\nMy English is terrible, and I used a translation tool, so I hope this is understandable.\n\n### Reproduction\n\nI have reproduced the issue. [stackblitz](https://stackblitz.com/edit/vite-bro9hm?file=docs%2F.vitepress%2Fconfig.ts)\n\n### Expected behavior\n\n正常显示\r\nDisplayed normally\n\n### System Info\n\n```Text\nSystem:\r\n OS: Windows 11 10.0.22631\r\n CPU: (32) x64 AMD Ryzen 9 7950X 16-Core Processor\r\n Memory: 38.28 GB / 63.19 GB\r\n Binaries:\r\n Node: 18.20.4 - ~\\AppData\\Local\\fnm_multishells\\106552_1720946934721\\node.EXE\r\n npm: 10.7.0 - ~\\AppData\\Local\\fnm_multishells\\106552_1720946934721\\npm.CMD\r\n Browsers:\r\n Edge: Chromium (126.0.2592.102)\r\n Internet Explorer: 11.0.22621.3527\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.",[2975],{"name":2965,"color":2966},4042,"v1.3.0 Mobile Nested Menu Does Not Display Subtitles","2024-07-22T04:41:59Z","https://github.com/vuejs/vitepress/issues/4042",0.74694425,["Reactive",2982],{},["Set"],["ShallowReactive",2985],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fcksMAyCNzjhzvum64fXVwh4Wvli4JSVz3qYpk6YbbdY":-1},"/vuejs/vitepress/4685"]