Fix trailing parentheses in URLs not being detected

Also fix URLs starting near the end of the line not being detected.

Fixes #3688
This commit is contained in:
Kovid Goyal
2021-06-04 18:13:36 +05:30
parent a8d1c73fec
commit 81411e6b54
8 changed files with 124 additions and 86 deletions

View File

@@ -19,10 +19,7 @@ is_url_char(uint32_t ch) {
static inline bool
can_strip_from_end_of_url(uint32_t ch) {
// remove trailing punctuation
return (
(is_P_category(ch) && ch != '/' && ch != '&' && ch != '-') ||
ch == '>'
) ? true : false;
return (is_P_category(ch) && ch != '/' && ch != '&' && ch != '-' && ch != ')' && ch != ']' && ch != '}');
}
static inline bool