summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-06-15 12:07:38 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-06-16 17:48:06 -0700
commit7bedf7d6b7dfae9681ac5d2c1631eb92d0c68e55 (patch)
tree2216d90a9ab719af2c8200f2b50fe6cea701fae6
parent3a75c999e475fde5e66b3990484ea0fd71dc41a9 (diff)
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.)
-rw-r--r--src/inlines.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/inlines.c b/src/inlines.c
index f4daeb1..c5b72ba 100644
--- 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)) ;