- Commit
- 7bedf7d6b7dfae9681ac5d2c1631eb92d0c68e55
- Parent
- 3a75c999e475fde5e66b3990484ea0fd71dc41a9
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
Don't rtrim in subject_from_buffer.
This gives bad results in parsing reference links,
where we might have trailing blanks.
(finalize in blocks.c removes the bytes parsed as
a reference definition; before this change, some
blank bytes might remain on the line.)
diff --git a/src/inlines.c b/src/inlines.c
@@ -169,8 +169,6 @@ static void subject_from_buf(subject *e, cmark_strbuf *buffer,
e->pos = 0;
e->refmap = refmap;
e->last_delim = NULL;
-
- cmark_chunk_rtrim(&e->input);
}
static inline int isbacktick(int c)
@@ -1129,6 +1127,7 @@ extern void cmark_parse_inlines(cmark_node* parent, cmark_reference_map *refmap,
{
subject subj;
subject_from_buf(&subj, &parent->string_content, refmap);
+ cmark_chunk_rtrim(&subj.input);
while (!is_eof(&subj) && parse_inline(&subj, parent, options)) ;