We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87e88f3 commit 31b8febCopy full SHA for 31b8feb
lib/webpack/markdownLoader.js
@@ -58,7 +58,7 @@ module.exports = function (src) {
58
// check if relative links are valid
59
links && links.forEach(link => {
60
const shortname = link
61
- .replace(/#[\w-]*$/, '')
+ .replace(/#.*$/, '')
62
.replace(/\.html$/, '.md')
63
const filename = shortname
64
.replace(/\/$/, '/README.md')
@@ -69,7 +69,7 @@ module.exports = function (src) {
69
const dir = path.dirname(this.resourcePath)
70
const file = path.resolve(dir, filename)
71
const altfile = altname !== filename ? path.resolve(dir, altname) : null
72
- if (!fs.existsSync(file) && (altfile && !fs.existsSync(altfile))) {
+ if (!fs.existsSync(file) && (!altfile || !fs.existsSync(altfile))) {
73
this.emitWarning(
74
new Error(
75
`\nFile for relative link "${link}" does not exist.\n` +
0 commit comments