Skip empty lines at end of code block

See https://spec.commonmark.org/0.29/#example-87
This commit is contained in:
Karl Bartel 2019-09-29 17:27:56 +02:00 committed by Enno Boland
parent 3e00caedeb
commit b76e431cc2

6
smu.c
View file

@ -219,6 +219,12 @@ dolineprefix(const char *begin, const char *end, int newblock) {
p += l; p += l;
} }
} }
/* Skip empty lines in block */
while(*(buffer + j - 1) == '\n') {
j--;
}
ADDC(buffer, j) = '\0'; ADDC(buffer, j) = '\0';
if(lineprefix[i].process) if(lineprefix[i].process)
process(buffer, buffer + strlen(buffer), lineprefix[i].process >= 2); process(buffer, buffer + strlen(buffer), lineprefix[i].process >= 2);