diff options
author | Yuki Izumi <yuki@kivikakk.ee> | 2017-06-23 15:52:05 +1000 |
---|---|---|
committer | Yuki Izumi <yuki@kivikakk.ee> | 2017-06-23 15:52:23 +1000 |
commit | 55b029fb66fbbaed969ce81ed77d57f033cd0db4 (patch) | |
tree | 6594ef91afff0c20c8c15cf6dae9665a399dd7dd | |
parent | 60aa732dcfc2578a96530bdd73262112fb6bbdf2 (diff) |
Reset bytes after UTF8 proc
See https://github.com/jgm/cmark/issues/206.
-rw-r--r-- | src/blocks.c | 2 |
1 files changed, 2 insertions, 0 deletions
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'); |