diff --git a/.gitignore b/.gitignore index 7bf9a27d..330a5686 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -/__tests__/e2e/.vitepress/cache /coverage /src/client/shared.ts /src/node/shared.ts @@ -10,6 +9,7 @@ .vite_opt_cache .vscode dist +cache examples-temp node_modules pnpm-global diff --git a/docs/test.md b/docs/test.md deleted file mode 100644 index 1e9f9cbe..00000000 --- a/docs/test.md +++ /dev/null @@ -1,84 +0,0 @@ -# Code Groups - -::: code-group - -```txt-vue{1} -{{ 1 + 1 }} -``` - -```js [app.vue] - - - - - -``` - - - -```vue-html{3,4} [layouts/custom.vue] - - - Some *custom* layout - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet mi in nunc faucibus consequat. - - - -``` - -```js{1-3,5} [layouts/default.vue] -export default { - name: 'MyComponent' - // ... -} - - - Some *custom* layout - - - -``` - -::: - -- in list - -- ::: code-group - - ```js - printf('111') - ``` - - ```python - import torch as th - print("Hello world") - ``` - - ``` - import torch as th - print("Hello world") - ``` - - ::: - -``` -. -├─ index.md -├─ foo -│ ├─ index.md -│ ├─ one.md -│ └─ two.md -└─ bar - ├─ index.md - ├─ three.md - └─ four.md -``` - -- ```md{1-3,5} - [Home](/) - [foo](/foo/) - [foo heading](./#heading) - [bar - three](../bar/three) - [bar - three](../bar/three.md) - [bar - four](../bar/four.html) - ``` diff --git a/package.json b/package.json index 7de34198..a4052efc 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,6 @@ "@vue/devtools-api": "^6.4.5", "@vueuse/core": "^9.6.0", "body-scroll-lock": "4.0.0-beta.0", - "nanoid": "3.3.4", "shiki": "^0.11.1", "vite": "^4.0.0", "vue": "^3.2.45" @@ -139,6 +138,7 @@ "markdown-it-emoji": "^2.0.2", "micromatch": "^4.0.5", "minimist": "^1.2.7", + "nanoid": "^3.3.4", "npm-run-all": "^4.1.5", "ora": "^5.4.1", "picocolors": "^1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aedac2a7..0261a3d9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,7 +59,7 @@ importers: markdown-it-emoji: ^2.0.2 micromatch: ^4.0.5 minimist: ^1.2.7 - nanoid: 3.3.4 + nanoid: ^3.3.4 npm-run-all: ^4.1.5 ora: ^5.4.1 picocolors: ^1.0.0 @@ -92,7 +92,6 @@ importers: '@vue/devtools-api': 6.4.5 '@vueuse/core': 9.6.0_vue@3.2.45 body-scroll-lock: 4.0.0-beta.0 - nanoid: 3.3.4 shiki: 0.11.1 vite: 4.0.0_@types+node@18.11.13 vue: 3.2.45 @@ -146,6 +145,7 @@ importers: markdown-it-emoji: 2.0.2 micromatch: 4.0.5 minimist: 1.2.7 + nanoid: 3.3.4 npm-run-all: 4.1.5 ora: 5.4.1 picocolors: 1.0.0 diff --git a/src/node/markdown/plugins/lineNumbers.ts b/src/node/markdown/plugins/lineNumbers.ts index 33a91f5d..076f3a78 100644 --- a/src/node/markdown/plugins/lineNumbers.ts +++ b/src/node/markdown/plugins/lineNumbers.ts @@ -21,7 +21,7 @@ export const lineNumberPlugin = (md: MarkdownIt) => { const finalCode = rawCode .replace(/<\/div>$/, `${lineNumbersWrapperCode}`) - .replace(/"(language-\S*?)"/, '"$1 line-numbers-mode"') + .replace(/"(language-[^"]*?)"/, '"$1 line-numbers-mode"') return finalCode }