summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-07-11 23:04:48 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2016-07-11 23:04:48 +0100
commit005d6d07cba0cb7fe17fd2148791bbfd382defcf (patch)
tree04001c9a526fe779f903a8b11126a38591577525 /src
parent41b3307db15bb02122223b8a16afeec54a9a69d7 (diff)
Fix mistaken sourcepos for atx headers.
Closes #141.
Diffstat (limited to 'src')
-rw-r--r--src/blocks.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/blocks.c b/src/blocks.c
index 6031c18..a5e667e 100644
--- a/src/blocks.c
+++ b/src/blocks.c
@@ -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);