diff --git a/inline_test.go b/inline_test.go index 847980a..06a63e7 100644 --- a/inline_test.go +++ b/inline_test.go @@ -604,6 +604,9 @@ func TestReferenceLink(t *testing.T) { "[ref]\n [ref]: ../url/ \"title\"\n", "

ref

\n", + + "[link][ref]\n [ref]: /url/", + "

link

\n", } doLinkTestsInline(t, tests) } diff --git a/markdown.go b/markdown.go index 9c3fdb0..7a72f4b 100644 --- a/markdown.go +++ b/markdown.go @@ -639,9 +639,6 @@ func scanLinkRef(p *parser, data []byte, i int) (linkOffset, linkEnd, titleOffse for i < len(data) && data[i] != ' ' && data[i] != '\t' && data[i] != '\n' && data[i] != '\r' { i++ } - if i == len(data) { - return - } linkEnd = i if data[linkOffset] == '<' && data[linkEnd-1] == '>' { linkOffset++