mirror of
https://github.com/status-im/markdown.git
synced 2025-02-23 16:48:14 +00:00
Merge pull request #264 from moorereason/iss263
Fix definition lists that contain other lists
This commit is contained in:
commit
2004188462
5
block.go
5
block.go
@ -1175,8 +1175,9 @@ gatherlines:
|
|||||||
|
|
||||||
if containsBlankLine {
|
if containsBlankLine {
|
||||||
// end the list if the type changed after a blank line
|
// end the list if the type changed after a blank line
|
||||||
if (*flags&LIST_TYPE_ORDERED != 0 && p.uliPrefix(chunk) > 0) ||
|
if indent <= itemIndent &&
|
||||||
(*flags&LIST_TYPE_ORDERED == 0 && p.oliPrefix(chunk) > 0) {
|
((*flags&LIST_TYPE_ORDERED != 0 && p.uliPrefix(chunk) > 0) ||
|
||||||
|
(*flags&LIST_TYPE_ORDERED == 0 && p.oliPrefix(chunk) > 0)) {
|
||||||
|
|
||||||
*flags |= LIST_ITEM_END_OF_LIST
|
*flags |= LIST_ITEM_END_OF_LIST
|
||||||
break gatherlines
|
break gatherlines
|
||||||
|
@ -960,6 +960,14 @@ func TestDefinitionList(t *testing.T) {
|
|||||||
"<dd><p>Definition b</p></dd>\n" +
|
"<dd><p>Definition b</p></dd>\n" +
|
||||||
"</dl>\n" +
|
"</dl>\n" +
|
||||||
"\n<p>Text 2</p>\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)
|
doTestsBlock(t, tests, EXTENSION_DEFINITION_LISTS)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user