Skip to content

Commit

Permalink
Merge pull request #264 from moorereason/iss263
Browse files Browse the repository at this point in the history
Fix definition lists that contain other lists
  • Loading branch information
rtfb committed May 10, 2016
2 parents 43529be + acc07e6 commit 2004188
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions block.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 2004188

Please sign in to comment.