File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,6 @@ const url = require('url');
2
2
3
3
const beginsWithDocsDomainRegex = / ^ h t t p s ? : \/ \/ w e b p a c k \. j s \. o r g / ;
4
4
5
- const redirects = {
6
- '/guides/migrating/#json-loader-is-not-required-anymore' : '/migrate/3#json-loader-is-not-required-anymore'
7
- } ;
8
-
9
5
module . exports = function processREADME ( body , options = { } ) {
10
6
return body
11
7
. replace ( / [ ^ ] * ?< d i v a l i g n = " c e n t e r " > ( [ ^ ] * ?) < \/ d i v > / , ( match , content ) => {
@@ -26,6 +22,7 @@ module.exports = function processREADME(body, options = {}) {
26
22
href = href . replace ( '//www.npmjs.com' ) ;
27
23
}
28
24
25
+ // Only resolve non-absolute urls from their source if they are not a document fragment link
29
26
if ( ! href . startsWith ( '#' ) ) {
30
27
href = url . resolve ( options . source , href ) ;
31
28
}
@@ -35,10 +32,6 @@ module.exports = function processREADME(body, options = {}) {
35
32
href = href . replace ( beginsWithDocsDomainRegex , '' ) ;
36
33
}
37
34
38
- if ( href in redirects ) {
39
- href = redirects [ href ] ;
40
- }
41
-
42
35
if ( oldHref !== href ) {
43
36
console . log ( 'REWRITE URL:' , oldHref , '-->' , href ) ;
44
37
}
You can’t perform that action at this time.
0 commit comments