ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: Fix up quote RE so it matches quoted empty lines again.
Date Tue, 01 Nov 2016 00:32:50 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/coffee-and-cake e4c49a4a3 -> 403919c87


Fix up quote RE so it matches quoted empty lines again.

This broke when space was made mandatory between > and text
Also fixes pre-existing issue where first line of text after the quote
was hauled up to before quote.

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/403919c8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/403919c8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/403919c8

Branch: refs/heads/coffee-and-cake
Commit: 403919c87e508da2933824dc4baec439c7334228
Parents: e4c49a4
Author: Sebb <sebb@apache.org>
Authored: Tue Nov 1 00:32:33 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Tue Nov 1 00:32:33 2016 +0000

----------------------------------------------------------------------
 site/js/coffee/misc.coffee | 6 +++++-
 site/js/ponymail-coffee.js | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/403919c8/site/js/coffee/misc.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/misc.coffee b/site/js/coffee/misc.coffee
index fba42d5..8ea10cd 100644
--- a/site/js/coffee/misc.coffee
+++ b/site/js/coffee/misc.coffee
@@ -91,7 +91,11 @@ ponymail_url_regex = new RegExp(
 )
 
 ponymail_quote_regex = new RegExp(
-    "((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]+[^\r\n]*\r?\n[^\n]*\n*)+)+)+",
"mi"
+    "((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+([ \t][^\r\n]*|[ \t]*)\r?\n)+)+)+",
"mi"
+    #                                                      ^                    ^
+    # This section matches at least one space plus any text, or optional whitespace only
+    # Quotes shold always have at least one space before any text, but don't need spaces
+    # if there is no text 
 )
 
 ###*

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/403919c8/site/js/ponymail-coffee.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail-coffee.js b/site/js/ponymail-coffee.js
index 18e2b90..2cf75f0 100644
--- a/site/js/ponymail-coffee.js
+++ b/site/js/ponymail-coffee.js
@@ -2429,7 +2429,7 @@ Array.prototype.remove = function(val) {
 
 ponymail_url_regex = new RegExp("(" + "(?:(?:[a-z]+)://)" + "(?:\\S+(?::\\S*)?@)?" + "(?:"
+ "([01][0-9][0-9]|2[0-4][0-9]|25[0-5])" + "|" + "(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)"
+ "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*" + "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))"
+ "\\.?" + ")" + "(?::\\d{2,5})?" + "(?:[/?#]([^,<>()\\[\\] \\t\\r\\n]|(<[^:\\s]*?>|\\([^:\\s]*?\\)|\\[[^:\\s]*?\\]))*)?"
+ ")\\.?", "mi");
 
-ponymail_quote_regex = new RegExp("((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[
\t]+[^\r\n]*\r?\n[^\n]*\n*)+)+)+", "mi");
+ponymail_quote_regex = new RegExp("((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+([
\t][^\r\n]*|[ \t]*)\r?\n)+)+)+", "mi");
 
 
 /**
@@ -2446,7 +2446,7 @@ shortenURL = function(mid) {
   var a, arr, i, j, num, out, ref, res;
   arr = mid.split("@");
 
-  /* IF arr is 2 bits, it's fine to shorten it (meduim/long generator). if 3, then potentially
not (short generator) */
+  /* IF arr is 2 bits, it's fine to shorten it (medium/long generator). if 3, then potentially
not (short generator) */
   if (arr.length === 2 && (pm_config && pm_config.shortLinks)) {
     out = "";
 


Mime
View raw message