Merge pull request #264 from moorereason/iss263

Fix definition lists that contain other lists
pull/266/head
Vytautas Šaltenis 2016-05-10 22:09:22 +03:00
commit 2004188462
2 changed files with 11 additions and 2 deletions

View File

@ -1175,8 +1175,9 @@ gatherlines:
if containsBlankLine {
// end the list if the type changed after a blank line
if (*flags&LIST_TYPE_ORDERED != 0 && p.uliPrefix(chunk) > 0) ||
(*flags&LIST_TYPE_ORDERED == 0 && p.oliPrefix(chunk) > 0) {
if indent <= itemIndent &&
((*flags&LIST_TYPE_ORDERED != 0 && p.uliPrefix(chunk) > 0) ||
(*flags&LIST_TYPE_ORDERED == 0 && p.oliPrefix(chunk) > 0)) {
*flags |= LIST_ITEM_END_OF_LIST
break gatherlines

View File

@ -960,6 +960,14 @@ func TestDefinitionList(t *testing.T) {
"<dd><p>Definition b</p></dd>\n" +
"</dl>\n" +
"\n<p>Text 2</p>\n",
"Term 1\n: Definition a\n\n Text 1\n\n 1. First\n 2. Second",
"<dl>\n" +
"<dt>Term 1</dt>\n" +
"<dd><p>Definition a</p>\n\n" +
"<p>Text 1</p>\n\n" +
"<ol>\n<li>First</li>\n<li>Second</li>\n</ol></dd>\n" +
"</dl>\n",
}
doTestsBlock(t, tests, EXTENSION_DEFINITION_LISTS)
}