diff --git a/block.go b/block.go index 6e61351..1f300b3 100644 --- a/block.go +++ b/block.go @@ -1186,7 +1186,10 @@ gatherlines: for data[next] != '\n' { next++ } - if next < len(data)-2 && data[next+1] != ':' { + for next < len(data)-1 && data[next] == '\n' { + next++ + } + if i < len(data)-1 && data[i] != ':' && data[next] != ':' { *flags |= LIST_ITEM_END_OF_LIST } } else { diff --git a/block_test.go b/block_test.go index 4819c6b..f52506f 100644 --- a/block_test.go +++ b/block_test.go @@ -820,6 +820,16 @@ func TestDefinitionList(t *testing.T) { "
Definition b
Text 1
\n", + + "Term 1\n\n: Definition a\n\nText 1\n\nTerm 2\n\n: Definition b\n\nText 2", + "Definition a
Text 1
\n" + + "\nDefinition b
Text 2
\n", } doTestsBlock(t, tests, EXTENSION_DEFINITION_LISTS) }