cmark

Unnamed repository; edit this file 'description' to name the repository.

commit f904f701cf4390b4d5531c5626c5cf08d85a913f
parent d55f1130acf9708de4f74556767251f8ed85e356
Author: John MacFarlane <jgm@berkeley.edu>
Date:   Mon, 15 Jun 2015 11:31:36 -0700

Fixed cases like

```
[ref]: url
"title" ok
```

Here we should parse the first line as a reference.

Diffstat:
Msrc/inlines.c | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git 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);