File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ module.exports = function (src) {
58
58
// check if relative links are valid
59
59
links && links . forEach ( link => {
60
60
const shortname = link
61
- . replace ( / # [ \w - ] * $ / , '' )
61
+ . replace ( / # . * $ / , '' )
62
62
. replace ( / \. h t m l $ / , '.md' )
63
63
const filename = shortname
64
64
. replace ( / \/ $ / , '/README.md' )
@@ -69,7 +69,7 @@ module.exports = function (src) {
69
69
const dir = path . dirname ( this . resourcePath )
70
70
const file = path . resolve ( dir , filename )
71
71
const altfile = altname !== filename ? path . resolve ( dir , altname ) : null
72
- if ( ! fs . existsSync ( file ) && ( altfile && ! fs . existsSync ( altfile ) ) ) {
72
+ if ( ! fs . existsSync ( file ) && ( ! altfile || ! fs . existsSync ( altfile ) ) ) {
73
73
this . emitWarning (
74
74
new Error (
75
75
`\nFile for relative link "${ link } " does not exist.\n` +
You can’t perform that action at this time.
0 commit comments