diff --git a/block.go b/block.go index 7cbffa51..005e27c8 100644 --- a/block.go +++ b/block.go @@ -2196,6 +2196,18 @@ gatherlines: *flags |= _LIST_ITEM_END_OF_LIST break gatherlines } + + if indent <= itemIndent && + ((*flags&_LIST_TYPE_DEFINITION != 0 && p.uliPrefix(chunk) > 0) || + (*flags&_LIST_TYPE_DEFINITION != 0 && p.oliPrefix(chunk) > 0) || + (*flags&_LIST_TYPE_DEFINITION != 0 && p.aliPrefix(chunk) > 0) || + (*flags&_LIST_TYPE_DEFINITION != 0 && p.aliPrefixU(chunk) > 0) || + (*flags&_LIST_TYPE_DEFINITION != 0 && p.rliPrefix(chunk) > 0) || + (*flags&_LIST_TYPE_DEFINITION != 0 && p.rliPrefixU(chunk) > 0)) { + *flags |= _LIST_ITEM_END_OF_LIST + break gatherlines + } + *flags |= _LIST_ITEM_CONTAINS_BLOCK } diff --git a/issue_test.go b/issue_test.go index dfa00b75..f33e89ea 100644 --- a/issue_test.go +++ b/issue_test.go @@ -36,7 +36,24 @@ func TestIssue73(t *testing.T) { As (@good) says `, "\n
    \n
  1. Example
  2. \n
\n\nAs (1) says\n\n", - } + `Mmark +: A Markdown-superset converter + +* [foo](http://bar)`, + "
\n
Mmark
\n
A Markdown-superset converter
\n
\n\n", + + `Mmark +: A Markdown-superset converter + + * [foo](http://bar)`, + "
\n
Mmark
\n
\nA Markdown-superset converter\n\n
\n
\n", + + `Mmark +: A Markdown-superset converter + +1. [foo](http://bar)`, + "
\n
Mmark
\n
A Markdown-superset converter
\n
\n
    \n
  1. foo
  2. \n
\n", + } doTestsBlockXML(t, tests, commonXmlExtensions) }