From b4138c5b9b284547f56d5bc1a3a77f1ab18acda0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 17 Mar 2019 12:05:19 -0700 Subject: In ends_with_blank_line, call S_set_last_line_blank... to avoid unnecessary repetition. Once we settle whether a list item ends in a blank line, we don't need to revisit this in considering parent list items. See commonmark/cmark#284. --- src/blocks.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/blocks.c') diff --git a/src/blocks.c b/src/blocks.c index bdd819e..fb2d54a 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -211,6 +211,7 @@ static bool ends_with_blank_line(cmark_node *node) { cmark_node *cur = node; while (cur != NULL) { if (S_last_line_blank(cur)) { + S_set_last_line_blank(node, true); return true; } if (S_type(cur) == CMARK_NODE_LIST || S_type(cur) == CMARK_NODE_ITEM) { @@ -219,6 +220,7 @@ static bool ends_with_blank_line(cmark_node *node) { cur = NULL; } } + S_set_last_line_blank(node, false); return false; } -- cgit v1.2.3