Skip to content

Commit 8c027c2

Browse files
authored
feat: add source param to the deadlink check fn (#4870)
1 parent 45e0d0f commit 8c027c2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/node/markdownToVue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,13 @@ export async function createMarkdownToVueRenderFn(
189189
return ignore.test(url)
190190
}
191191
if (typeof ignore === 'function') {
192-
return ignore(url)
192+
return ignore(url, fileOrig)
193193
}
194194
return false
195195
})
196196
}
197197

198-
if (links) {
198+
if (links && siteConfig?.ignoreDeadLinks !== true) {
199199
const dir = path.dirname(file)
200200
for (let url of links) {
201201
const { pathname } = new URL(url, 'http://a.com')

src/node/siteConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export interface UserConfig<ThemeConfig = any>
114114
ignoreDeadLinks?:
115115
| boolean
116116
| 'localhostLinks'
117-
| (string | RegExp | ((link: string) => boolean))[]
117+
| (string | RegExp | ((link: string, source: string) => boolean))[]
118118

119119
/**
120120
* Don't force `.html` on URLs.

0 commit comments

Comments
 (0)