Skip to content

Commit 27ba3a4

Browse files
Also handle CMARK_NODE_LIST
1 parent aa73711 commit 27ba3a4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/blocks.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,14 +1109,16 @@ static cmark_node *check_open_blocks(cmark_parser *parser, cmark_chunk *input,
11091109
const size_t n_para = read_open_block_count(&tmp_parser, CMARK_NODE_PARAGRAPH);
11101110
if (n_list + n_item + n_para == tmp_parser.total_open_blocks) {
11111111
if (parser->current->flags & CMARK_NODE__OPEN_BLOCK) {
1112-
if (S_type(parser->current) == CMARK_NODE_PARAGRAPH) {
1113-
container = parser->current;
1114-
goto done;
1115-
}
1116-
if (S_type(parser->current) == CMARK_NODE_ITEM) {
1117-
if (parser->current->flags & CMARK_NODE__OPEN) {
1112+
if (parser->current->flags & CMARK_NODE__OPEN) {
1113+
switch (S_type(parser->current)) {
1114+
case CMARK_NODE_PARAGRAPH:
1115+
case CMARK_NODE_LIST:
1116+
case CMARK_NODE_ITEM:
11181117
container = parser->current;
11191118
cont_type = S_type(container);
1119+
break;
1120+
default:
1121+
break;
11201122
}
11211123
}
11221124
}

0 commit comments

Comments
 (0)