Skip to content

Commit

Permalink
Merge pull request #29 from iterative/skip-colon-with-multiple-new-line
Browse files Browse the repository at this point in the history
  • Loading branch information
yathomasi authored Oct 14, 2022
2 parents 083ed25 + a058d5b commit f132ce4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "repo-link-check",
"version": "0.13.1",
"version": "0.13.2",
"description": "A multi-target library for ensuring all links in a file are alive",
"main": "index.js",
"author": "RMP",
Expand Down
4 changes: 4 additions & 0 deletions src/scrapeLinks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Markdown sample with a [link to Google](https://www.google.com), one [with a URL
- Finally a few [ref] [links][links] [here][link-here]
- BTW it shouldn't plain links like http://www.this.com or that.com shouldn't get picked up.
this is a test [ref]:
https://www.ref.com
[ref]: https://www.ref.com
[links]:
www.links.in/newline
Expand Down
2 changes: 1 addition & 1 deletion src/scrapeLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const scrapeFromString: (filePath: string, content: string) => string[] = (
)
const mdRefLinks = regexMap(
content,
/\[.*\]:\s*\n?\s*(.*)/gm,
/\[.*\]:[^\S\r\n]*\n?[^\S\r\n]*(.*)/gm,
x => x[2] || x[1]
)
const hrefLinks = regexMap(content, /href="(.*?)"/gm)
Expand Down

0 comments on commit f132ce4

Please sign in to comment.