summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAshe Connor <ashe@kivikakk.ee>2018-11-13 11:06:59 +1100
committerAshe Connor <ashe@kivikakk.ee>2018-11-13 11:06:59 +1100
commitd479c28a631731543e6276f807155388aa71acde (patch)
tree2ee14a588403d9c9ed1888d6270a6f6ca30668ad /src
parentcfba1fc382c54c625eb7ccdfd38ba1c5caf1ca97 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/inlines.c7
1 files changed, 4 insertions, 3 deletions
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) {