From 31423d6f7d2e1af5c22fdcc74b6e951f15a1130c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 17 Jan 2016 13:25:21 -0800 Subject: Commonmark renderer: use HTML comment to separate list from following list or code block. This has several advantages. First, the two blank lines breaks out of list syntax is still controversial in CommonMark. And it isn't used in other implementations. HTML comments will always work. Second, two blank lines breaks out of all lists; an HTML comment can be used to break out of just one level of nesting. --- src/commonmark.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/commonmark.c') diff --git a/src/commonmark.c b/src/commonmark.c index 55ca037..3eac076 100644 --- a/src/commonmark.c +++ b/src/commonmark.c @@ -193,9 +193,11 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node, case CMARK_NODE_LIST: if (!entering && node->next && (node->next->type == CMARK_NODE_CODE_BLOCK || node->next->type == CMARK_NODE_LIST)) { - // this ensures 2 blank lines after list, - // if before code block or list: - LIT("\n"); + // this ensures that a following code block or list will be + // inteprereted correctly. + CR(); + LIT(""); + BLANKLINE(); } break; -- cgit v1.2.3