summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-09-09 22:04:30 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-09-09 22:04:30 -0700
commitd0642637d89201a77086c727e8052af3f3baeadc (patch)
treeec3a3b9b3f35a90b48df1beb9f761659ebbaff16
parentc9817041afa133c5dc9869e5b309667861527c30 (diff)
Check for whitespace before reference title.
Closes #263.
-rw-r--r--src/inlines.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/inlines.c b/src/inlines.c
index bbda78f..171247e 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -1345,7 +1345,7 @@ bufsize_t cmark_parse_reference_inline(cmark_mem *mem, cmark_chunk *input,
// parse optional link_title
beforetitle = subj.pos;
spnl(&subj);
- matchlen = scan_link_title(&subj.input, subj.pos);
+ matchlen = subj.pos == beforetitle ? 0 : scan_link_title(&subj.input, subj.pos);
if (matchlen) {
title = cmark_chunk_dup(&subj.input, subj.pos, matchlen);
subj.pos += matchlen;