Skip to content

Commit

Permalink
Fix definition lists that contain other lists
Browse files Browse the repository at this point in the history
  • Loading branch information
moorereason committed May 6, 2016
1 parent 43529be commit acc07e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions block.go
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions block_test.go
Expand Up @@ -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)
}
Expand Down

0 comments on commit acc07e6

Please sign in to comment.