1 Based on https://github.com/thestinger/termite/pull/516
2 Modified to apply to v13
4 From 65a454ffa8e681f3f14729cba7c42e1570a85e8a Mon Sep 17 00:00:00 2001
5 From: Paul Baecher <pbaecher@gmail.com>
6 Date: Thu, 7 Sep 2017 22:58:51 +0200
7 Subject: [PATCH] Do not match punctuation at the end of URLs
9 Punctuation at the end of URLs is most likely part of natural language
10 or markup (for example in Markdown). Do not match it as part of the URL.
13 1 file changed, 1 insertion(+), 1 deletion(-)
15 diff --git a/url_regex.hh b/url_regex.hh
16 index 2ec6be8..3039b53 100644
20 #define PORT "(?:\\:[[:digit:]]{1,5})?"
21 #define SCHEME "(?:[[:alpha:]][+-.[:alnum:]]*:)"
22 #define USERPASS USERCHARS_CLASS "+(?:\\:" PASSCHARS_CLASS "+)?"
23 -#define URLPATH "(?:/[[:alnum:]\\Q-_.!~*'();/?:@&=+$,#%\\E]*)?"
24 +#define URLPATH "(?:/[[:alnum:]\\Q-_.!~*'();/?:@&=+$,#%\\E]*(?<![\\Q.,:;()!?\\E]))?"
26 const char * const url_regex = SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH;