Skip to content

Commit b32a02f

Browse files
authored
Merge pull request commonmark#201 from bdotdub/patch-1
[Autolink] Store positioning info for url_match
2 parents d401ba5 + d5b1fac commit b32a02f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

extensions/autolink.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ static cmark_node *url_match(cmark_parser *parser, cmark_node *parent,
267267
cmark_node *text = cmark_node_new_with_mem(CMARK_NODE_TEXT, parser->mem);
268268
text->as.literal = url;
269269
cmark_node_append_child(node, text);
270+
271+
node->start_line = text->start_line = node->end_line = text->end_line = cmark_inline_parser_get_line(inline_parser);
272+
273+
node->start_column = text->start_column = max_rewind - rewind;
274+
node->end_column = text->end_column = cmark_inline_parser_get_column(inline_parser) - 1;
270275

271276
return node;
272277
}

0 commit comments

Comments
 (0)