From f988ab6d41855de43c157633852f0fe3c0770c6d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 13 Jul 2016 12:33:38 -0700 Subject: Fix sourcepos for blockquotes. Fixes #142. --- src/blocks.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/blocks.c') diff --git a/src/blocks.c b/src/blocks.c index 7627f6e..5c04fc0 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -862,6 +862,8 @@ static void open_new_blocks(cmark_parser *parser, cmark_node **container, if (!indented && peek_at(input, parser->first_nonspace) == '>') { + bufsize_t blockquote_startpos = parser->first_nonspace; + S_advance_offset(parser, input, parser->first_nonspace + 1 - parser->offset, false); // optional following character @@ -869,7 +871,7 @@ static void open_new_blocks(cmark_parser *parser, cmark_node **container, S_advance_offset(parser, input, 1, true); } *container = add_child(parser, *container, CMARK_NODE_BLOCK_QUOTE, - parser->offset + 1); + blockquote_startpos + 1); } else if (!indented && (matched = scan_atx_heading_start( input, parser->first_nonspace))) { -- cgit v1.2.3