From 7650e6ced60aad073d5c5f4bf64b34be0655759f Mon Sep 17 00:00:00 2001
From: Nicolas Werner <nicolas.werner@hotmail.de>
Date: Thu, 9 Jul 2020 13:26:01 +0200
Subject: [PATCH] Fix autolinking breaking on single quotes in href attribute

Fixes #234
---
 src/Config.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Config.h b/src/Config.h
index f99cf36b6..c06247090 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.
-- 
GitLab