Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix definition lists that contain other lists #264

Merged
merged 1 commit into from
May 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment still up to date despite the code change below? Just checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be updated.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I wait for your change or should I merge right away?

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