From d479c28a631731543e6276f807155388aa71acde Mon Sep 17 00:00:00 2001 From: Ashe Connor Date: Tue, 13 Nov 2018 11:06:59 +1100 Subject: copy line/col info straight from opener/closer We can't rely on anything in `subj` since it's been modified while parsing the subject and could represent line info from a future line. This is simple and works. --- src/inlines.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/inlines.c') diff --git a/src/inlines.c b/src/inlines.c index 171247e..d31173d 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -732,9 +732,10 @@ static delimiter *S_insert_emph(subject *subj, delimiter *opener, } cmark_node_insert_after(opener_inl, emph); - emph->start_line = emph->end_line = subj->line; - emph->start_column = opener_inl->start_column + subj->column_offset; - emph->end_column = closer_inl->end_column + subj->column_offset; + emph->start_line = opener_inl->start_line; + emph->end_line = closer_inl->end_line; + emph->start_column = opener_inl->start_column; + emph->end_column = closer_inl->end_column; // if opener has 0 characters, remove it and its associated inline if (opener_num_chars == 0) { -- cgit v1.2.3