diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/inlines.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/inlines.c b/src/inlines.c index e6b491f..d9301c8 100644 --- a/src/inlines.c +++ b/src/inlines.c @@ -439,8 +439,9 @@ static int scan_delims(subject *subj, unsigned char c, bool *can_open, *can_close = right_flanking && (!left_flanking || cmark_utf8proc_is_punctuation(after_char)); } else if (c == '\'' || c == '"') { - *can_open = left_flanking && !right_flanking && - before_char != ']' && before_char != ')'; + *can_open = left_flanking && + (!right_flanking || before_char == '(' || before_char == '[') && + before_char != ']' && before_char != ')'; *can_close = right_flanking; } else { *can_open = left_flanking; @@ -954,7 +955,7 @@ static bufsize_t manual_scan_link_url_2(cmark_chunk *input, bufsize_t offset, } } - if (i >= input->len) + if (i >= input->len || nb_p != 0) return -1; { |