Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(md-enhance): fix cjk character issue with link check, fix #2547
- Loading branch information
1 parent
cd47d6f
commit 9d0f8d4
Showing
16 changed files
with
77 additions
and
17 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
packages/md-enhance/__tests__/unit/__fixtures__/src/link-check/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Links Check | ||
|
||
- [a](./a.md) | ||
- [b](./b.md) | ||
- [中文](./中文.md) | ||
- [Not exist](./not-exist.md) | ||
|
||
- [a](a.md) | ||
- [b](b.md) | ||
- [中文](中文.md) | ||
- [Not exist](not-exist.md) | ||
|
||
## Sub Folder | ||
|
||
- [a](./sub-folder/a.md) | ||
- [b](./sub-folder/b.md) | ||
- [中文](./sub-folder/中文.md) | ||
- [Not exist](./sub-folder/not-exist.md) | ||
|
||
- [a](sub-folder/a.md) | ||
- [b](sub-folder/b.md) | ||
- [中文](sub-folder/中文.md) | ||
- [Not exist](sub-folder/not-exist.md) |
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions
11
...ages/md-enhance/__tests__/unit/__fixtures__/src/link-check/sub-folder/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Links Check | ||
|
||
- [a](./a.md) | ||
- [b](./b.md) | ||
- [中文](./中文.md) | ||
- [Not exist](./not-exist.md) | ||
|
||
- [a](a.md) | ||
- [b](b.md) | ||
- [中文](中文.md) | ||
- [Not exist](not-exist.md) |
Empty file.
Empty file.
Empty file.
Empty file.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
packages/md-enhance/__tests__/unit/__fixtures__/theme/empty.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { Theme } from "@vuepress/core"; | ||
|
||
export const emptyTheme: Theme = { | ||
name: "vuepress-theme-empty", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { createBaseApp } from "@vuepress/core"; | ||
import { path } from "@vuepress/utils"; | ||
import { it } from "vitest"; | ||
import { checkLinks } from "../../src/node/checkLink.js"; | ||
|
||
import { emptyTheme } from "./__fixtures__/theme/empty.js"; | ||
|
||
it("should check links correctly", async () => { | ||
const app = createBaseApp({ | ||
bundler: {} as any, | ||
source: path.resolve(__dirname, "./__fixtures__/src"), | ||
theme: emptyTheme, | ||
}); | ||
|
||
await app.init(); | ||
|
||
app.pages.forEach((page) => checkLinks(page, app)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters