Skip to content

Commit

Permalink
Fix mistaken sourcepos for atx headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Jul 11, 2016
1 parent 41b3307 commit 005d6d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/blocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -851,12 +851,13 @@ static void open_new_blocks(cmark_parser *parser, cmark_node **container,
input, parser->first_nonspace))) {
bufsize_t hashpos;
int level = 0;
bufsize_t heading_startpos = parser->first_nonspace;

S_advance_offset(parser, input,
parser->first_nonspace + matched - parser->offset,
false);
*container =
add_child(parser, *container, CMARK_NODE_HEADING, parser->offset + 1);
add_child(parser, *container, CMARK_NODE_HEADING, heading_startpos + 1);

hashpos = cmark_chunk_strchr(input, '#', parser->first_nonspace);

Expand Down

0 comments on commit 005d6d0

Please sign in to comment.