diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-06-15 11:31:36 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-06-15 11:31:36 -0700 |
commit | f904f701cf4390b4d5531c5626c5cf08d85a913f (patch) | |
tree | e30ad3fe4ab29f62c0892a74c36bc1c7c119629d | |
parent | d55f1130acf9708de4f74556767251f8ed85e356 (diff) |
Fixed cases like
```
[ref]: url
"title" ok
```
Here we should parse the first line as a reference.
-rw-r--r-- | src/inlines.c | 10 |
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); |