Skip to content

Commit 8fb0520

Browse files
committed
Don't resolve external README internal fragment identifier hrefs to raw.githubusercontent.com
1 parent a18805e commit 8fb0520

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/scripts/fetch_package_files.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ function fetchPackageFiles(options, finalCb) {
8787
// Examples:
8888
// - [click here](LICENSE) --> [click here](https://raw.githubusercontent.com/user/repository/branch/LICENSE)
8989
// - [click here](./LICENSE) --> [click here](https://raw.githubusercontent.com/user/repository/branch/LICENSE)
90-
// - [click here](#LICENSE) --> [click here](https://raw.githubusercontent.com/user/repository/branch#LICENSE)
91-
.replace(/\[([^[\]]*)\]\(([^)]+)\)/g, (match, textContent, href) => `[${textContent}](${urlModule.resolve(url, href)})`)
90+
// - [click here](#LICENSE) --> [click here](#LICENSE)
91+
.replace(/\[([^[\]]*)\]\(([^)#]+)\)/g, (match, textContent, href) => `[${textContent}](${urlModule.resolve(url, href)})`)
9292
// Modify links to keep them within the site
9393
.replace(/https?:\/\/github.com\/(webpack|webpack-contrib)\/([-A-za-z0-9]+-loader\/?)([)"])/g, '/loaders/$2/$3')
9494
.replace(/https?:\/\/github.com\/(webpack|webpack-contrib)\/([-A-za-z0-9]+-plugin\/?)([)"])/g, '/plugins/$2/$3')

0 commit comments

Comments
 (0)