\n\n\u003Cimg width=\"376\" height=\"181\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/2f33e227-2f78-4d2d-a90e-796eb5842643\" />\n\n### Reproduction\n\nUse the default tempalte \"no style\" and add a code block with line-numbers.\n\nTested version: \"vitepress\": \"^1.6.3\"\n\n### Expected behavior\n\nThe line numbers are next to the code.\n\n### System Info\n\n```Text\nSystem:\n OS: Windows 10 10.0.19045\n CPU: (16) x64 AMD Ryzen 7 5800X3D 8-Core Processor\n Memory: 11.37 GB / 31.92 GB\n Binaries:\n Node: 22.3.0 - C:\\Program Files\\nodejs\\node.EXE\n Yarn: 1.22.17 - ~\\AppData\\Roaming\\npm\\yarn.CMD\n npm: 9.8.1 - C:\\Program Files\\nodejs\\npm.CMD\n Browsers:\n Chrome: 138.0.7204.169\n Edge: Chromium (136.0.3240.92)\n Internet Explorer: 11.0.19041.5794\n npmPackages:\n vitepress: ^1.6.3 => 1.6.3\n```\n\n### Additional context\n\nTested on Chrome, Edge and Firefox - all have the same issue.\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.",[3058],{"name":3059,"color":3060},"bug: pending triage","e99695",4865,"markdown :line-numbers","2025-07-29T22:58:24Z","https://github.com/vuejs/vitepress/issues/4865",0.7110774,{"description":3067,"labels":3068,"number":3069,"owner":3030,"repository":3031,"state":3050,"title":3070,"updated_at":3071,"url":3072,"score":3073},"### Is your feature request related to a problem? Please describe.\r\n\r\nI'm writing programming learning text, and I want to specify the start line number on code block to show a part of the whole code.\r\nThe below is an example file.\r\n\r\nindex.js\r\n\\```\r\nconst ddd = 'eee'\r\nfunction aaa(){\r\n const bbb = 'ccc'\r\n console.log(bbb)\r\n}\r\n\\```\r\n\r\nThen, when I want to show only this `aaa` function, I want to let vitepress show as below(I want to start the line number with 2).\r\n\r\n2 function aaa(){\r\n3 const bbb = 'ccc'\r\n4 console.log(bbb)\r\n5 }\r\n\r\nBut with current features of vitepress, we cannot realize it.\r\n\r\n### Describe the solution you'd like\r\n\r\nI suggest below writing rule.\r\n\r\n\\```js @2\r\nfunction aaa(){\r\n const bbb = 'ccc'\r\n console.log(bbb)\r\n}\r\n\\```\r\n\r\nor\r\n\r\n\\```js:line-numbers @2\r\nfunction aaa(){\r\n const bbb = 'ccc'\r\n console.log(bbb)\r\n}\r\n\\```\r\n\r\nWith `@`, I want to specify the start line number(of course, other than `@` is also ok).\r\n\r\n\r\n### Describe alternatives you've considered\r\n\r\n_No response_\r\n\r\n### Additional context\r\n\r\nHackMD allows to specify the start line with below way.\r\nhttps://hackmd.io/features?both#Code-Block\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.",[],2907,"Specifing the start line number on code block","2023-09-18T00:04:18Z","https://github.com/vuejs/vitepress/issues/2907",0.7129586,{"description":3075,"labels":3076,"number":3083,"owner":3030,"repository":3031,"state":3050,"title":3084,"updated_at":3085,"url":3086,"score":3087},"### Describe the bug\n\nWhen allowing word wrap in code blocks, the line numbers don't work correctly.\r\n\r\n\n\n### Reproduction\n\n1. set the code block to allow text wrap:\r\n\r\n```\r\n code {\r\n white-space: pre-wrap !important;\r\n }\r\n```\r\n\r\n2. set line numbers to true in config.ts\r\n```\r\nexport default defineConfig({\r\n markdown: { lineNumbers: true }\r\n})\r\n```\r\n\r\n4. write a long line of code, you can see something like the following:\r\n\r\n\u003Cimg width=\"726\" alt=\"image\" src=\"https://github.com/vuejs/vitepress/assets/3367820/12fbabb1-7adf-40a9-a740-d73b57aef4d1\">\r\n\n\n### Expected behavior\n\nThe line number should not increment until a new line met\n\n### System Info\n\n```sh\nSystem:\r\n OS: macOS 13.4.1\r\n CPU: (10) x64 Apple M1 Pro\r\n Memory: 32.79 MB / 16.00 GB\r\n Shell: 5.9 - /bin/zsh\r\n Binaries:\r\n Node: 18.12.0 - ~/.nvm/versions/node/v18.12.0/bin/node\r\n Yarn: 1.22.19 - ~/.yarn/bin/yarn\r\n npm: 8.19.2 - ~/.nvm/versions/node/v18.12.0/bin/npm\r\n Watchman: 2023.05.08.00 - /opt/homebrew/bin/watchman\r\n Browsers:\r\n Safari: 16.5.1\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.",[3077,3080],{"name":3078,"color":3079},"theme","0754FB",{"name":3081,"color":3082},"has-workaround","1B4515",2567,"Code line numbers don't work well with text wrap","2023-07-10T00:05:11Z","https://github.com/vuejs/vitepress/issues/2567",0.7192782,{"description":3089,"labels":3090,"number":3094,"owner":3030,"repository":3031,"state":3050,"title":3095,"updated_at":3096,"url":3097,"score":3098},"### Describe the bug\n\nAccording to [the configuration option](https://vitepress.vuejs.org/config/app-configs.html#markdown) of the documentation, this option is enabled:\r\n\r\n```ts\r\n// .vitepress/config.ts\r\nexport default defineConfig({\r\n // ...\r\n markdown: {\r\n lineNumbers: true,\r\n },\r\n // ...\r\n})\r\n```\r\n\r\nNot getting the expected result showing line numbers , by the way, the code snippets of the documentation also have no line numbers:\r\n\r\n\r\n\r\n\n\n### Reproduction\n\n```ts\r\n// .vitepress/config.ts\r\nexport default defineConfig({\r\n // ...\r\n markdown: {\r\n lineNumbers: true,\r\n },\r\n // ...\r\n})\r\n```\n\n### Expected behavior\n\nShow the code line numbers.\r\n\r\n\r\n\n\n### System Info\n\n```shell\nSystem:\r\n OS: Windows 10 10.0.19044\r\n CPU: (12) x64 Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz\r\n Memory: 8.46 GB / 15.91 GB\r\n Binaries:\r\n Node: 16.15.0 - D:\\Programs\\nodejs\\node.EXE\r\n Yarn: 1.22.18 - ~\\AppData\\Roaming\\npm\\yarn.CMD\r\n npm: 8.11.0 - D:\\Programs\\nodejs\\npm.CMD\r\n Browsers:\r\n Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.62)\r\n Internet Explorer: 11.0.19041.1202\r\n npmPackages:\r\n vitepress: ^1.0.0-alpha.4 => 1.0.0-alpha.4\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.vuejs.org).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[3091],{"name":3092,"color":3093},"need more info","bdbefc",1046,"markdown.lineNumbers doesn't work under default theme","2023-01-21T14:30:12Z","https://github.com/vuejs/vitepress/issues/1046",0.7376402,{"description":3100,"labels":3101,"number":3102,"owner":3030,"repository":3031,"state":3050,"title":3103,"updated_at":3104,"url":3105,"score":3106},"### Describe the bug\n\nThe line highlighting features are broke now in the official vitepress documentation: \u003Chttps://vitepress.vuejs.org/guide/markdown.html#line-highlighting-in-code-blocks>\n\n### Reproduction\n\nOpen \u003Chttps://vitepress.vuejs.org/guide/markdown.html#line-highlighting-in-code-blocks> and discover the lines are not highlighted:\r\n\r\n\r\n\r\nCan also be reproduced locally with:\r\n\r\n```shell\r\n$ mkdir vtprs && cd vtprs\r\n$ yarn init\r\n$ yarn add --dev vitepress\r\n```\r\n\r\nWrite some code blocks with lines highlighted in `docs/index.md`, like\r\n\u003Cpre>\r\n```toml{2}\r\n[highlight]\r\nnot_highlighted = true\r\npublic = false\r\n```\r\n\u003C/pre>\r\n\r\nrun `yarn vitepress dev docs` and discover that second line is not highlighted as expected.\n\n### Expected behavior\n\nCode lines are highlighted with minimal setup.\n\n### System Info\n\n```shell\nSystem:\r\n OS: Linux 5.14 Arch Linux\r\n CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz\r\n Memory: 5.12 GB / 15.49 GB\r\n Container: Yes\r\n Shell: 5.8 - /usr/bin/zsh\r\n Binaries:\r\n Node: 14.17.4 - /sbin/node\r\n Yarn: 1.22.15 - /sbin/yarn\r\n npm: 7.24.2 - /sbin/npm\r\n Browsers:\r\n Chromium: 94.0.4606.71\r\n Firefox: 93.0\r\n npmPackages:\r\n vitepress: ^0.19.2 => 0.19.2\n```\n\n\n### Additional context\n\n_No response_\n\n### Validations\n\n- [X] Follow our [Code of Conduct](https://vuejs.org/coc)\n- [X] Read the [docs](https://vitepress.vuejs.org/).\n- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.",[],408,"Line Highlighting in Code Blocks breaks in v0.19.2","2023-01-21T16:20:27Z","https://github.com/vuejs/vitepress/issues/408",0.73776823,{"description":3108,"labels":3109,"number":3110,"owner":3030,"repository":3031,"state":3050,"title":3111,"updated_at":3112,"url":3113,"score":3114},"\u003C!--\r\nNOTE:\r\nVitePress is still WIP, and it is not compatible with VuePress.\r\nPlease do not open issue about default theme missing features or something doesn't work like VuePress.\r\n-->\r\n\r\n**Describe the bug**\r\nWhen creating a code block using line highlighting, it does not highlight the correct line. Instead it seems to highlight the line between the desired line and the previous line.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n\r\nCreate a new vitepress project. In any markdown page create a codeblock and specify the line to highlight. Check the output and the correct line will not be highlighted.\r\n\r\nExample:\r\n\r\n```md\r\n## Usage\r\n```html{3}\r\n\u003Ctemplate>\r\n \u003Cdiv>\r\n \u003Ckro-button @click=\"delete\">Delete Cake\u003C/kro-button>\r\n \u003C/div>\r\n\u003C/template>\r\n\r\n\u003Cscript setup>\r\n import { useDialog } from '@black-kro/ui';\r\n\r\n const { createDialog } = useDialog();\r\n\r\n export const delete = () => {\r\n createDialog({\r\n title: 'Delete Cake?',\r\n message: 'Are you sure you would like to delete the cake?',\r\n })\r\n .then(() => {\r\n // Delete Cake.\r\n })\r\n .catch(() => {\r\n // Don't delete Cake.\r\n })\r\n }\r\n\u003C/script>\r\n```\r\n\r\nOutput:\r\n\r\n\r\n**Expected behavior**\r\nLine 3 should be highlighted.\r\n\r\n**System Info**\r\n- vitepress version: 0.5.0\r\n- vite version: 1.0.0-rc.3\r\n- Node version: 14.7.0\r\n- OS version: Windows 10\r\n",[],63,"Code block line highlighting not highlighting correct line","2023-01-21T16:22:16Z","https://github.com/vuejs/vitepress/issues/63",0.74107385,{"description":3116,"labels":3117,"number":3121,"owner":3030,"repository":3031,"state":3050,"title":3122,"updated_at":3123,"url":3124,"score":3125},"### Describe the bug\r\n\r\n```md\r\n```js\r\n// [!code ++:4]\r\nconsole.log(1);\r\nconsole.log(1);\r\n\r\nconsole.log(1);\r\n\\```\r\n```\r\n\r\nRenders this following example:\r\n\r\n\r\n\r\nThis is due because a `\u003Cspan class=\"line diff add\">\u003C/span>` (line 3) is created without any content, if we change it to `\u003Cspan class=\"line diff add\"> \u003C/span>`, it now renders correctly.\r\n\r\n\r\n\r\nNot sure if a blank space is the best fix. \r\n\r\nAlso, should a line only containing `// [!code ++:4]` be highlighted as well? \r\n\r\n### Reproduction\r\n\r\nabove\r\n\r\n### Expected behavior\r\n\r\nto work normally\r\n\r\n### System Info\r\n\r\n```Text\r\nSystem:\r\n OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)\r\n CPU: (20) x64 13th Gen Intel(R) Core(TM) i5-13600K\r\n Memory: 16.53 GB / 23.47 GB\r\n Container: Yes\r\n Shell: 5.8.1 - /usr/bin/zsh\r\n Binaries:\r\n Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node\r\n npm: 10.2.1 - ~/.nvm/versions/node/v20.9.0/bin/npm\r\n pnpm: 8.10.5 - ~/.nvm/versions/node/v20.9.0/bin/pnpm\r\n bun: 1.0.7 - ~/.bun/bin/bun\r\n npmPackages:\r\n vitepress: 1.0.0-rc.31 => 1.0.0-rc.31\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.",[3118],{"name":3119,"color":3120},"build","377ba8",3305,"Colored Diffs in empty lines breaks + symbol","2024-01-08T00:04:50Z","https://github.com/vuejs/vitepress/issues/3305",0.75253105,["Reactive",3127],{},["Set"],["ShallowReactive",3130],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fcJBNn8KQ38jkRUldLr2g8IZa75AQ6pTkWxDbR1Zr85Q":-1},"/vuejs/vitepress/4751"]