commit b43ef8e63a9d3c1b1ba33bd66e2611dba8ec5e8b
parent e61a8158cafb8bfad115eacfab296c76d141fe12
Author: Martin Mitas <mity@morous.org>
Date: Sun, 27 Nov 2016 00:50:24 +0100
md_link_label_eq: Treat new line as an unicode whitespace.
It fixes this:
[Foo
bar]: /url
[Baz][Foo bar]
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/md4c/md4c.c b/md4c/md4c.c
@@ -1609,7 +1609,7 @@ md_skip_unicode_whitespace(const CHAR* label, OFF off, SZ size)
while(off < size) {
codepoint = md_decode_unicode(label, off, size, &char_size);
- if(!ISUNICODEWHITESPACE_(codepoint))
+ if(!ISUNICODEWHITESPACE_(codepoint) && !ISNEWLINE_(label[off]))
break;
off += char_size;
}
@@ -1637,7 +1637,7 @@ md_link_label_eq(const CHAR* a_label, SZ a_size, const CHAR* b_label, SZ b_size)
if(a_off < a_size) {
a_codepoint = md_decode_unicode(a_label, a_off, a_size, &a_char_size);
- a_is_whitespace = ISUNICODEWHITESPACE_(a_codepoint);
+ a_is_whitespace = ISUNICODEWHITESPACE_(a_codepoint) || ISNEWLINE_(a_label[a_off]);
} else {
/* Treat end of label as a whitespace. */
a_codepoint = -1;
@@ -1646,7 +1646,7 @@ md_link_label_eq(const CHAR* a_label, SZ a_size, const CHAR* b_label, SZ b_size)
if(b_off < b_size) {
b_codepoint = md_decode_unicode(b_label, b_off, b_size, &b_char_size);
- b_is_whitespace = ISUNICODEWHITESPACE_(b_codepoint);
+ b_is_whitespace = ISUNICODEWHITESPACE_(b_codepoint) || ISNEWLINE_(b_label[b_off]);
} else {
/* Treat end of label as a whitespace. */
b_codepoint = -1;