summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-07-09 13:26:01 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-07-09 13:26:01 +0200
commit7650e6ced60aad073d5c5f4bf64b34be0655759f (patch)
treec2ccc06e801dae7d514420ceddde8e6a776e8f97 /src
parentOpen url using QDesktopServices from Qml (diff)
downloadnheko-7650e6ced60aad073d5c5f4bf64b34be0655759f.tar.xz
Fix autolinking breaking on single quotes in href attribute
Fixes #234
Diffstat (limited to 'src')
-rw-r--r--src/Config.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Config.h b/src/Config.h
index f99cf36b..c0624709 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -53,9 +53,9 @@ namespace strings {
 const QString url_html = "<a href=\"\\1\">\\1</a>";
 const QRegularExpression url_regex(
   // match an URL, that is not quoted, i.e.
-  // vvvvvv match quote via negative lookahead/lookbehind                    vv
-  //       vvvv atomic match url -> fail if there is a " before or after          vvv
-  R"((?<!")(?>((www\.(?!\.)|[a-z][a-z0-9+.-]*://)[^\s<>'"]+[^!,\.\s<>'"\]\)\:]))(?!"))");
+  // vvvvvv match quote via negative lookahead/lookbehind                              vv
+  //          vvvv atomic match url -> fail if there is a " before or after        vvv
+  R"((?<!["'])(?>((www\.(?!\.)|[a-z][a-z0-9+.-]*://)[^\s<>'"]+[^!,\.\s<>'"\]\)\:]))(?!["']))");
 }
 
 // Window geometry.