summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/blocks.c b/src/blocks.c
index 8d6fd06..bcec27a 100644
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -460,6 +460,10 @@ static void incorporate_line(strbuf *line, int line_number, node_block** curptr)
int indent;
chunk input;
+ // Add a newline to the end if not present:
+ if (line->ptr[line->size - 1] != '\n') {
+ strbuf_putc(line, '\n');
+ }
input.data = line->ptr;
input.len = line->size;