Skip to content

Commit b776a59

Browse files
committed
Add support for a without href, without children
1 parent 85a5b3c commit b776a59

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

handlers/link.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var all = require('../all');
66

77
function link(h, node) {
88
var props = {
9-
url: node.properties.href,
9+
url: node.properties.href || '',
1010
title: node.properties.title || null
1111
};
1212

tests/fixtures/a/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
<p><a href="http://example.com" title="example">example</a></p>
2-
<p><a href="http://example.com">example</a></p>
2+
<p><a href="http://example.com">example</a></p>
3+
<p><a>example</a></p>
4+
<p><a></a></p>

tests/fixtures/a/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[example](http://example.com "example")
22

33
[example](http://example.com)
4+
5+
[example](<>)
6+
7+
[](<>)

0 commit comments

Comments
 (0)