summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-06-15 11:31:36 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-06-15 11:31:36 -0700
commitf904f701cf4390b4d5531c5626c5cf08d85a913f (patch)
treee30ad3fe4ab29f62c0892a74c36bc1c7c119629d /src
parentd55f1130acf9708de4f74556767251f8ed85e356 (diff)
Fixed cases like
``` [ref]: url "title" ok ``` Here we should parse the first line as a reference.
Diffstat (limited to 'src')
-rw-r--r--src/inlines.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/inlines.c b/src/inlines.c
index 28250e1..f4daeb1 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -1196,7 +1196,15 @@ bufsize_t cmark_parse_reference_inline(cmark_strbuf *input, cmark_reference_map
// parse final spaces and newline:
skip_spaces(&subj);
if (!skip_line_end(&subj)) {
- return 0;
+ if (matchlen) { // try rewinding before title
+ subj.pos = beforetitle;
+ skip_spaces(&subj);
+ if (!skip_line_end(&subj)) {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
}
// insert reference into refmap
cmark_reference_create(refmap, &lab, &url, &title);