Skip to content

Commit b92a6f5

Browse files
authored
Remove url rewriting for evaluating reidirects of broken links in process-readme
1 parent edb1d93 commit b92a6f5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/utilities/process-readme.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ const url = require('url');
22

33
const beginsWithDocsDomainRegex = /^https?:\/\/webpack\.js\.org/;
44

5-
const redirects = {
6-
'/guides/migrating/#json-loader-is-not-required-anymore': '/migrate/3#json-loader-is-not-required-anymore'
7-
};
8-
95
module.exports = function processREADME(body, options = {}) {
106
return body
117
.replace(/[^]*?<div align="center">([^]*?)<\/div>/, (match, content) => {
@@ -26,6 +22,7 @@ module.exports = function processREADME(body, options = {}) {
2622
href = href.replace('//www.npmjs.com');
2723
}
2824

25+
// Only resolve non-absolute urls from their source if they are not a document fragment link
2926
if (!href.startsWith('#')) {
3027
href = url.resolve(options.source, href);
3128
}
@@ -35,10 +32,6 @@ module.exports = function processREADME(body, options = {}) {
3532
href = href.replace(beginsWithDocsDomainRegex, '');
3633
}
3734

38-
if (href in redirects) {
39-
href = redirects[href];
40-
}
41-
4235
if (oldHref !== href) {
4336
console.log('REWRITE URL:', oldHref, '-->', href);
4437
}

0 commit comments

Comments
 (0)