Skip to content

Commit

Permalink
Fix sourcepos for blockquotes.
Browse files Browse the repository at this point in the history
Fixes #142.
  • Loading branch information
jgm committed Jul 13, 2016
1 parent e1f188f commit f988ab6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/blocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,16 @@ 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
if (S_is_space_or_tab(peek_at(input, parser->offset))) {
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))) {
Expand Down

0 comments on commit f988ab6

Please sign in to comment.