From 74e37a46cc65b2ea6709815b475bde6c2126a107 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Tue, 3 Mar 2020 10:36:52 -0500 Subject: [PATCH] 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,