Fix autolinking breaking on single quotes in href attribute

Fixes #234
This commit is contained in:
Nicolas Werner 2020-07-09 13:26:01 +02:00
parent 8d3ab300b6
commit 7650e6ced6

View file

@ -55,7 +55,7 @@ const QRegularExpression url_regex(
// match an URL, that is not quoted, i.e. // match an URL, that is not quoted, i.e.
// vvvvvv match quote via negative lookahead/lookbehind vv // vvvvvv match quote via negative lookahead/lookbehind vv
// vvvv atomic match url -> fail if there is a " before or after vvv // vvvv atomic match url -> fail if there is a " before or after vvv
R"((?<!")(?>((www\.(?!\.)|[a-z][a-z0-9+.-]*://)[^\s<>'"]+[^!,\.\s<>'"\]\)\:]))(?!"))"); R"((?<!["'])(?>((www\.(?!\.)|[a-z][a-z0-9+.-]*://)[^\s<>'"]+[^!,\.\s<>'"\]\)\:]))(?!["']))");
} }
// Window geometry. // Window geometry.