summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-03-26 12:20:15 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-03-26 12:20:15 -0700
commitfaf7ab378518b6ad8792603a41c641cb13b2ff83 (patch)
treebbc9d36e286a1bd56b94139359d7d42355f98ff9 /src
parente3990d751b96dbaa91ca9cdb20749c9002402ff6 (diff)
Fix #289.
A link destination can't start with `<` unless it is an angle-bracket link that also ends with `>`. (If your URL really starts with `<`, URL-escape it.)
Diffstat (limited to 'src')
-rw-r--r--src/inlines.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/inlines.c b/src/inlines.c
index 6e92aff..6f93fd4 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -967,13 +967,10 @@ static bufsize_t manual_scan_link_url(cmark_chunk *input, bufsize_t offset,
} else if (input->data[i] == '\\')
i += 2;
else if (input->data[i] == '\n' || input->data[i] == '<')
- return manual_scan_link_url_2(input, offset, output);
+ return -1;
else
++i;
}
- if (i >= input->len) {
- return manual_scan_link_url_2(input, offset, output);
- }
} else {
return manual_scan_link_url_2(input, offset, output);
}