Fix Wikipedia URL detection - URLs inside parentheses won't work

This commit is contained in:
Berke Viktor 2012-10-07 13:27:44 +02:00
parent 59f32ccb3a
commit 8df11c030c
2 changed files with 8 additions and 1 deletions

View File

@ -106,7 +106,8 @@ url_add (char *urltext, int len)
len--;
data[len] = 0;
}
if (data[len - 1] == ')') /* chop trailing ) */
/* chop trailing ) but only if there's no counterpart */
if (data[len - 1] == ')' && strchr (data, '(') == NULL)
data[len - 1] = 0;
if (!url_tree)

View File

@ -84,9 +84,15 @@
#endif
/* is delimiter */
#if 0
/* () is used by Wikipedia */
#define is_del(c) \
(c == ' ' || c == '\n' || c == ')' || c == '(' || \
c == '>' || c == '<' || c == ATTR_RESET || c == ATTR_BOLD || c == 0)
#endif
#define is_del(c) \
(c == ' ' || c == '\n' || c == '>' || c == '<' || \
c == ATTR_RESET || c == ATTR_BOLD || c == 0)
#ifdef SCROLL_HACK
/* force scrolling off */