Skip to content

Commit 4942011

Browse files
authored
Merge pull request #49 from iterative/fix/link-selector
2 parents f2b1a55 + 0ffd058 commit 4942011

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "repo-link-check",
3-
"version": "0.14.0",
3+
"version": "0.14.1",
44
"description": "A multi-target library for ensuring all links in a file are alive",
55
"main": "index.js",
66
"author": "RMP",

src/scrapeLinks.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Markdown sample with a [link to Google](https://www.google.com), one [with a URL
88
- Finally a few [ref] [links][links] [here][link-here]
99
- BTW it shouldn't plain links like http://www.this.com or that.com shouldn't get picked up.
1010
11+
12+
) -> List[Dict]:
13+
\`\`\`
1114
this is a test [ref]:
1215
1316
https://www.ref.com

src/scrapeLinks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const scrapeFromString: (filePath: string, content: string) => string[] = (
2929
)
3030
const mdRefLinks = regexMap(
3131
content,
32-
/\[.*\]:[^\S\r\n]*\n?[^\S\r\n]*(.*)/gm,
32+
/\[.*\]:[^\S\r\n]*\n?[^\S\r\n]*([\w\d./?=#\-&_~:;,@+$!*()]+)/gm,
3333
x => x[2] || x[1]
3434
)
3535
const hrefLinks = regexMap(content, /href="(.*?)"/gm)

0 commit comments

Comments
 (0)