summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-03-17 12:05:19 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-03-17 12:05:19 -0700
commitb4138c5b9b284547f56d5bc1a3a77f1ab18acda0 (patch)
tree6b6ad26360f3694155d82f8c3645627f4257d553 /src/blocks.c
parent478195cad776469a8532b11b798d9e520652ef64 (diff)
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.
Diffstat (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c2
1 files changed, 2 insertions, 0 deletions
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;
}