Commit 8df11c03 authored by Berke Viktor's avatar Berke Viktor

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

parent 59f32ccb
......@@ -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)
......
......@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment