smu

Simple markup processor
git clone https://git.sinitax.com/codemadness/smu
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit 2a8d5b1a6bd8f7e30dc4b932b1ab698a75497710
parent 23241209f80b4961d706b151d718e1c5b2d5c632
Author: Karl Bartel <karl42@gmail.com>
Date:   Thu,  3 Oct 2019 13:24:15 +0200

Handle empty lines with whitespace in lists

Diffstat:
Msmu.c | 16++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/smu.c b/smu.c @@ -371,12 +371,16 @@ dolist(const char *begin, const char *end, int newblock) { if(*p == '\n') { if(p + 1 == end) break; - else if(p[1] == '\n') { - p++; - ADDC(buffer, i) = '\n'; - i++; - run = 0; - isblock++; + else { + /* Handle empty lines */ + for(q = p + 1; (*q == ' ' || *q == '\t') && q < end; q++); + if(*q == '\n') { + ADDC(buffer, i) = '\n'; + i++; + run = 0; + isblock++; + p = q; + } } q = p + 1; j = 0;