[geary: 1/2] Avoid overlong regex line in javascript.



commit 74e37a46cc65b2ea6709815b475bde6c2126a107
Author: Daniel Kahn Gillmor <dkg fifthhorseman net>
Date:   Tue Mar 3 10:36:52 2020 -0500

    Avoid overlong regex line in javascript.
    
    The regex line in this javascript was > 256 characters, which triggers
    the following warning from debian's "lintian" source-checking tool:
    
        https://lintian.debian.org/tags/source-is-missing.html
        https://lintian.debian.org/tags/source-contains-prebuilt-javascript-object.html
    
    This offers no functional change, but avoids some needless warnings
    going forward.

 ui/composer-web-view.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/ui/composer-web-view.js b/ui/composer-web-view.js
index fc5dbf91..ca918990 100644
--- a/ui/composer-web-view.js
+++ b/ui/composer-web-view.js
@@ -18,7 +18,9 @@ ComposerPageState.QUOTE_MARKER = "\x7f"; // delete
 ComposerPageState.PROTOCOL_REGEX = 
/^(aim|apt|bitcoin|cvs|ed2k|ftp|file|finger|git|gtalk|http|https|irc|ircs|irc6|lastfm|ldap|ldaps|magnet|news|nntp|rsync|sftp|skype|smb|sms|svn|telnet|tftp|ssh|webcal|xmpp):/i;
 // Taken from Geary.HTML.URL_REGEX, without the inline modifier (?x)
 // at the start, which is unsupported in JS
-ComposerPageState.URL_REGEX = new 
RegExp("\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))",
 "gi");
+ComposerPageState.URL_REGEX = new 
RegExp("\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)"+
+                                         "(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+"+
+                                         
"(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))", "gi");
 
 ComposerPageState.prototype = {
     __proto__: PageState.prototype,


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