From 55b029fb66fbbaed969ce81ed77d57f033cd0db4 Mon Sep 17 00:00:00 2001 From: Yuki Izumi Date: Fri, 23 Jun 2017 15:52:05 +1000 Subject: Reset bytes after UTF8 proc See https://github.com/jgm/cmark/issues/206. --- src/blocks.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/blocks.c') diff --git a/src/blocks.c b/src/blocks.c index 98868d3..5a293b2 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -1146,6 +1146,8 @@ static void S_process_line(cmark_parser *parser, const unsigned char *buffer, else cmark_strbuf_put(&parser->curline, buffer, bytes); + bytes = parser->curline.size; + // ensure line ends with a newline: if (bytes == 0 || !S_is_line_end_char(parser->curline.ptr[bytes - 1])) cmark_strbuf_putc(&parser->curline, '\n'); -- cgit v1.2.3