Skip to content

Commit d879029

Browse files
authored
Merge branch 'master' into Munter-patch-1
2 parents e9b3953 + e3c1e2e commit d879029

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/scripts/fetch_package_files.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ function fetchPackageFiles(options, finalCb) {
8383
// Replace lone h1 formats
8484
.replace(/<h1.*?>.+?<\/h1>/, '')
8585
.replace(/# .+/, '')
86-
// Modify links to keep them within the site
87-
.replace(/https?:\/\/github.com\/(webpack|webpack-contrib)\/([-A-za-z0-9]+-loader\/?)([)"])/g, '/loaders/$2/$3')
88-
.replace(/https?:\/\/github.com\/(webpack|webpack-contrib)\/([-A-za-z0-9]+-plugin\/?)([)"])/g, '/plugins/$2/$3')
89-
// Replace any <h2> with `##`
90-
.replace(/<h2[^>]*>/g, '## ')
91-
.replace(/<\/h2>/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(/https?:\/\/github.com\/(webpack|webpack-contrib)\/([-A-za-z0-9]+-loader\/?)([)"])/g, '/loaders/$2/$3')
94+
.replace(/https?:\/\/github.com\/(webpack|webpack-contrib)\/([-A-za-z0-9]+-plugin\/?)([)"])/g, '/plugins/$2/$3')
95+
// Replace any <h2> with `##`
96+
.replace(/<h2[^>]*>/g, '## ')
97+
.replace(/<\/h2>/g, '')
9898
// Drop any comments
9999
.replace(/<!--[\s\S]*?-->/g, '');
100100
}

0 commit comments

Comments
 (0)