@@ -83,18 +83,18 @@ function fetchPackageFiles(options, finalCb) {
83
83
// Replace lone h1 formats
84
84
. replace ( / < h 1 .* ?> .+ ?< \/ h 1 > / , '' )
85
85
. replace ( / # .+ / , '' )
86
- // Modify links to keep them within the site
87
- . replace ( / h t t p s ? : \/ \/ g i t h u b .c o m \/ ( w e b p a c k | w e b p a c k - c o n t r i b ) \/ ( [ - A - z a - z 0 - 9 ] + - l o a d e r \/ ? ) ( [ ) " ] ) / g, '/loaders/$2/$3' )
88
- . replace ( / h t t p s ? : \/ \/ g i t h u b .c o m \/ ( w e b p a c k | w e b p a c k - c o n t r i b ) \/ ( [ - A - z a - z 0 - 9 ] + - p l u g i n \/ ? ) ( [ ) " ] ) / g, '/plugins/$2/$3' )
89
- // Replace any <h2> with `##`
90
- . replace ( / < h 2 [ ^ > ] * > / g, '## ' )
91
- . replace ( / < \/ h 2 > / g, '' )
92
86
// Resolve anchor hrefs to avoid broken relative references in the docs
93
87
// Examples:
94
88
// - [click here](LICENSE) --> [click here](https://raw.githubusercontent.com/user/repository/branch/LICENSE)
95
89
// - [click here](./LICENSE) --> [click here](https://raw.githubusercontent.com/user/repository/branch/LICENSE)
96
90
// - [click here](#LICENSE) --> [click here](https://raw.githubusercontent.com/user/repository/branch#LICENSE)
97
91
. replace ( / \[ ( [ ^ [ \] ] * ) \] \( ( [ ^ ) ] + ) \) / g, ( match , textContent , href ) => `[${ textContent } ](${ urlModule . resolve ( url , href ) } )` )
92
+ // Modify links to keep them within the site
93
+ . replace ( / h t t p s ? : \/ \/ g i t h u b .c o m \/ ( w e b p a c k | w e b p a c k - c o n t r i b ) \/ ( [ - A - z a - z 0 - 9 ] + - l o a d e r \/ ? ) ( [ ) " ] ) / g, '/loaders/$2/$3' )
94
+ . replace ( / h t t p s ? : \/ \/ g i t h u b .c o m \/ ( w e b p a c k | w e b p a c k - c o n t r i b ) \/ ( [ - A - z a - z 0 - 9 ] + - p l u g i n \/ ? ) ( [ ) " ] ) / g, '/plugins/$2/$3' )
95
+ // Replace any <h2> with `##`
96
+ . replace ( / < h 2 [ ^ > ] * > / g, '## ' )
97
+ . replace ( / < \/ h 2 > / g, '' )
98
98
// Drop any comments
99
99
. replace ( / < ! - - [ \s \S ] * ?- - > / g, '' ) ;
100
100
}
0 commit comments