Skip to content

Commit 135b797

Browse files
authored
fix(build): fix code groups for line numbers mode (#1700)
1 parent a684b67 commit 135b797

File tree

5 files changed

+5
-89
lines changed

5 files changed

+5
-89
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/__tests__/e2e/.vitepress/cache
21
/coverage
32
/src/client/shared.ts
43
/src/node/shared.ts
@@ -10,6 +9,7 @@
109
.vite_opt_cache
1110
.vscode
1211
dist
12+
cache
1313
examples-temp
1414
node_modules
1515
pnpm-global

docs/test.md

-84
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
"@vue/devtools-api": "^6.4.5",
8585
"@vueuse/core": "^9.6.0",
8686
"body-scroll-lock": "4.0.0-beta.0",
87-
"nanoid": "3.3.4",
8887
"shiki": "^0.11.1",
8988
"vite": "^4.0.0",
9089
"vue": "^3.2.45"
@@ -139,6 +138,7 @@
139138
"markdown-it-emoji": "^2.0.2",
140139
"micromatch": "^4.0.5",
141140
"minimist": "^1.2.7",
141+
"nanoid": "^3.3.4",
142142
"npm-run-all": "^4.1.5",
143143
"ora": "^5.4.1",
144144
"picocolors": "^1.0.0",

pnpm-lock.yaml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node/markdown/plugins/lineNumbers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const lineNumberPlugin = (md: MarkdownIt) => {
2121

2222
const finalCode = rawCode
2323
.replace(/<\/div>$/, `${lineNumbersWrapperCode}</div>`)
24-
.replace(/"(language-\S*?)"/, '"$1 line-numbers-mode"')
24+
.replace(/"(language-[^"]*?)"/, '"$1 line-numbers-mode"')
2525

2626
return finalCode
2727
}

0 commit comments

Comments
 (0)