Fix panic parsing list definition
parent
4c9bf95126
commit
97535d7a15
2
block.go
2
block.go
|
@ -1360,7 +1360,7 @@ gatherlines:
|
|||
if *flags&ListTypeDefinition != 0 && i < len(data)-1 {
|
||||
// is the next item still a part of this list?
|
||||
next := i
|
||||
for next < len(data) && data[next] != '\n' {
|
||||
for next < len(data)-1 && data[next] != '\n' {
|
||||
next++
|
||||
}
|
||||
for next < len(data)-1 && data[next] == '\n' {
|
||||
|
|
|
@ -34,6 +34,10 @@ func TestDocument(t *testing.T) {
|
|||
// https://github.com/russross/blackfriday/issues/173
|
||||
" [",
|
||||
"<p>[</p>\n",
|
||||
|
||||
// This should't panic.
|
||||
"text\n\n:item: **text**\ntext\n",
|
||||
"<dl>\n<dt>text</dt>\n</dl>\n\n<p>:item: <strong>text</strong>\ntext</p>\n",
|
||||
}
|
||||
doTests(t, tests)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue