Skip to content

Commit

Permalink
Merge pull request #201 from bdotdub/patch-1
Browse files Browse the repository at this point in the history
[Autolink] Store positioning info for url_match
  • Loading branch information
phillmv authored Jan 31, 2023
2 parents d401ba5 + d5b1fac commit b32a02f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extensions/autolink.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ static cmark_node *url_match(cmark_parser *parser, cmark_node *parent,
cmark_node *text = cmark_node_new_with_mem(CMARK_NODE_TEXT, parser->mem);
text->as.literal = url;
cmark_node_append_child(node, text);

node->start_line = text->start_line = node->end_line = text->end_line = cmark_inline_parser_get_line(inline_parser);

node->start_column = text->start_column = max_rewind - rewind;
node->end_column = text->end_column = cmark_inline_parser_get_column(inline_parser) - 1;

return node;
}
Expand Down

0 comments on commit b32a02f

Please sign in to comment.