Skip to content

Commit f132ce4

Browse files
authored
Merge pull request #29 from iterative/skip-colon-with-multiple-new-line
2 parents 083ed25 + a058d5b commit f132ce4

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-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.13.1",
3+
"version": "0.13.2",
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ 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+
this is a test [ref]:
12+
13+
https://www.ref.com
14+
1115
[ref]: https://www.ref.com
1216
[links]:
1317
www.links.in/newline

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*\n?\s*(.*)/gm,
32+
/\[.*\]:[^\S\r\n]*\n?[^\S\r\n]*(.*)/gm,
3333
x => x[2] || x[1]
3434
)
3535
const hrefLinks = regexMap(content, /href="(.*?)"/gm)

0 commit comments

Comments
 (0)