cmark

My personal build of CMark ✏️

Commit
b4138c5b9b284547f56d5bc1a3a77f1ab18acda0
Parent
478195cad776469a8532b11b798d9e520652ef64
Author
John MacFarlane <jgm@berkeley.edu>
Date

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

1 file changed, 2 insertions, 0 deletions

Status File Name N° Changes Insertions Deletions
Modified src/blocks.c 2 2 0
diff --git 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;
 }