From f4c56706bc083f9792420fb1af2ae8cdf9651bb7 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 7 Mar 2018 20:10:41 +0100 Subject: Don't create runs for \newpara Removes a load more special cases --- src/sc_parse.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/sc_parse.c') diff --git a/src/sc_parse.c b/src/sc_parse.c index b39d183..23bf2d0 100644 --- a/src/sc_parse.c +++ b/src/sc_parse.c @@ -541,10 +541,19 @@ static void separate_newlines(SCBlock *bl) bl->contents = NULL; nb = bl; } else { - sc_block_append(bl, strdup("newpara"), NULL, NULL, &nb); + sc_block_append(bl, strdup("newpara"), + NULL, NULL, &nb); } + + /* Follow \newpara with an empty block so that + * all paragraphs have at least one SCBlock */ + sc_block_append(nb, NULL, NULL, strdup(""), + NULL); + + /* Add any text after the \n */ if ( strlen(npos+1) > 0 ) { - sc_block_append(nb, NULL, NULL, strdup(npos+1), &nb); + sc_block_append(nb, NULL, NULL, + strdup(npos+1), &nb); } npos[0] = '\0'; } -- cgit v1.2.3