Skip to content

Commit c320354

Browse files
committed
Fix bug where links without urls failed
1 parent 65fcad8 commit c320354

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/util/parse-link.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var CC_HASH = '#'.charCodeAt(0);
3737
*/
3838
function parse(node) {
3939
var link = {};
40-
var url = node.url || /* istanbul ignore next - remark@<4.0.0 */ node.href;
40+
var url = node.url || node.href || '';
4141
var start;
4242
var end;
4343
var page;

test/fixtures/links/input.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ pretty.
1111

1212
## Non-references
1313

14+
An empty link: [this and that]().
15+
1416
A link to GH:
1517
<https://github.com>
1618

test/fixtures/links/output.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ pretty.
1111

1212
## Non-references
1313

14+
An empty link: [this and that](<>).
15+
1416
A link to GH:
1517
<https://github.com>
1618

0 commit comments

Comments
 (0)