mirror of
https://github.com/danog/blackfriday.git
synced 2025-01-22 13:21:36 +01:00
Merge pull request #250 from tomkwok/master
Fix regession: index out of range panic in reference link (#172, #173)
This commit is contained in:
commit
151efb040f
@ -722,6 +722,10 @@ func TestReferenceLink(t *testing.T) {
|
||||
|
||||
"[link][ref]\n [ref]: /url/",
|
||||
"<p><a href=\"/url/\">link</a></p>\n",
|
||||
|
||||
// Issue 172 in blackfriday
|
||||
"[]:<",
|
||||
"<p>[]:<</p>\n",
|
||||
}
|
||||
doLinkTestsInline(t, tests)
|
||||
}
|
||||
|
@ -635,6 +635,9 @@ func scanLinkRef(p *parser, data []byte, i int) (linkOffset, linkEnd, titleOffse
|
||||
i++
|
||||
}
|
||||
linkOffset = i
|
||||
if i == len(data) {
|
||||
return
|
||||
}
|
||||
for i < len(data) && data[i] != ' ' && data[i] != '\t' && data[i] != '\n' && data[i] != '\r' {
|
||||
i++
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user