[evolution/wip/webkit2] EHTMLEditorView - Don't include non-breaking space while recognizing links



commit 2e972a0b7c9ef6a063216be9f101b75c5e419c5b
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Mar 3 12:48:47 2016 +0100

    EHTMLEditorView - Don't include non-breaking space while recognizing links

 .../e-html-editor-selection-dom-functions.h        |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/web-extensions/composer/e-html-editor-selection-dom-functions.h 
b/web-extensions/composer/e-html-editor-selection-dom-functions.h
index b8ca5d0..65c2d82 100644
--- a/web-extensions/composer/e-html-editor-selection-dom-functions.h
+++ b/web-extensions/composer/e-html-editor-selection-dom-functions.h
@@ -28,9 +28,10 @@
 
 /* stephenhay from https://mathiasbynens.be/demo/url-regex */
 #define URL_PROTOCOLS "news|telnet|nntp|file|https?|s?ftp||webcal|localhost|ssh"
-#define URL_PATTERN "((((" URL_PROTOCOLS ")\\:\\/\\/)|(www\\.|ftp\\.))[^\\s\\/\\$\\.\\?#].[^\\s]*)(?=&nbsp;)"
-
-#define URL_PATTERN_SPACE URL_PATTERN "\\s"
+#define URL_PATTERN_BASE "(?=((?:(?:(?:" URL_PROTOCOLS 
")\\:\\/\\/)|(?:www\\.|ftp\\.))[^\\s\\/\\$\\.\\?#].[^\\s]*)"
+#define URL_PATTERN_NO_NBSP ")((?!&nbsp;).)*"
+#define URL_PATTERN URL_PATTERN_BASE URL_PATTERN_NO_NBSP
+#define URL_PATTERN_SPACE URL_PATTERN_BASE "\\s$" URL_PATTERN_NO_NBSP
 /* Taken from camel-url-scanner.c */
 #define URL_INVALID_TRAILING_CHARS ",.:;?!-|}])\""
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]