mirror of
https://github.com/danog/blackfriday.git
synced 2024-11-26 20:14:43 +01:00
Don't require the input to end with a newline
Technically, not ending a line with a newline is wrong, but this blunder is so pervasive that we have no other choice but to live with it. Fixes #180.
This commit is contained in:
parent
e3cbadc5c9
commit
bcd6dd8711
@ -695,6 +695,9 @@ func TestReferenceLink(t *testing.T) {
|
||||
|
||||
"[ref]\n [ref]: ../url/ \"title\"\n",
|
||||
"<p><a href=\"../url/\" title=\"title\">ref</a></p>\n",
|
||||
|
||||
"[link][ref]\n [ref]: /url/",
|
||||
"<p><a href=\"/url/\">link</a></p>\n",
|
||||
}
|
||||
doLinkTestsInline(t, tests)
|
||||
}
|
||||
|
@ -638,9 +638,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++
|
||||
|
Loading…
Reference in New Issue
Block a user