@@ -83,18 +83,18 @@ function fetchPackageFiles(options, finalCb) {
8383 // Replace lone h1 formats
8484 . replace ( / < h 1 .* ?> .+ ?< \/ h 1 > / , '' )
8585 . 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, '' )
9286 // Resolve anchor hrefs to avoid broken relative references in the docs
9387 // Examples:
9488 // - [click here](LICENSE) --> [click here](https://raw.githubusercontent.com/user/repository/branch/LICENSE)
9589 // - [click here](./LICENSE) --> [click here](https://raw.githubusercontent.com/user/repository/branch/LICENSE)
9690 // - [click here](#LICENSE) --> [click here](https://raw.githubusercontent.com/user/repository/branch#LICENSE)
9791 . 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, '' )
9898 // Drop any comments
9999 . replace ( / < ! - - [ \s \S ] * ?- - > / g, '' ) ;
100100 }
0 commit comments