summaryrefslogtreecommitdiff
path: root/src/blocks.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-07-13 12:33:38 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2016-07-13 12:33:56 -0700
commitf988ab6d41855de43c157633852f0fe3c0770c6d (patch)
tree70cfa0ad5e39bfd0a5cd34981eb4fa3dae3165ab /src/blocks.c
parente1f188f651973e1902e92148d4ee93a80ee602e8 (diff)
Fix sourcepos for blockquotes.
Fixes #142.
Diffstat (limited to 'src/blocks.c')
-rw-r--r--src/blocks.c4
1 files changed, 3 insertions, 1 deletions
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))) {