You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2017/10/30 15:13:46 UTC
[4/5] incubator-ponymail git commit: space after a > can be optional
space after a > can be optional
we don't want to display a single > if it's a quote of an empty line.
it can get noisy
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/ca537e73
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/ca537e73
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/ca537e73
Branch: refs/heads/master
Commit: ca537e733b6b7096b83ca105a625e5ad1abda110
Parents: 724837d
Author: Daniel Gruno <hu...@apache.org>
Authored: Mon Oct 30 16:13:10 2017 +0100
Committer: Daniel Gruno <hu...@apache.org>
Committed: Mon Oct 30 16:13:10 2017 +0100
----------------------------------------------------------------------
site/js/dev/ponymail_email_displays.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/ca537e73/site/js/dev/ponymail_email_displays.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_email_displays.js b/site/js/dev/ponymail_email_displays.js
index 913f453..b440399 100644
--- a/site/js/dev/ponymail_email_displays.js
+++ b/site/js/dev/ponymail_email_displays.js
@@ -73,7 +73,7 @@ function displayEmail(json, id, level) {
ebody = "\n" + ebody // add a newline at top
// If we're compacting quotes in the email, let's...do so with some fuzzy logic
if (prefs.compactQuotes == 'yes') {
- ebody = ebody.replace(/((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]+[^\r\n]*\r?\n[^\n]*\n*)+)+)+/mgi, function(inner) {
+ ebody = ebody.replace(/((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]*[^\r\n]*\r?\n[^\n]*\n*)+)+)+/mgi, function(inner) {
var rnd = (Math.random() * 100).toString()
inner = inner.replace(/>/g, ">")
var html = "<div class='bs-callout bs-callout-default' style='margin: 3px; padding: 2px;' id='parent_" + rnd + "'>" +
Re: [4/5] incubator-ponymail git commit: space after a > can be optional
Posted by sebb <se...@gmail.com>.
The following works better for me:
ebody = ebody.replace(/((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my
.+)|(>+([ \t]+[^\r\n]*)?\r?\n)+)+)+/mgi, function(inner) {
It no longer swallows replies that are added without surrounding blank lines
But it needs some proper testing.
On 30 October 2017 at 17:27, sebb <se...@gmail.com> wrote:
> On 30 October 2017 at 16:29, sebb <se...@gmail.com> wrote:
>> This needs a bug report/test messages.
>> It looks wrong to me; there must be whitespace after the last >
> Or rather, there must be whitespace after > and before any text on the line.
> The RE needs to handle the empty line specially.
>> On 30 October 2017 at 15:13, <hu...@apache.org> wrote:
>>> space after a > can be optional
>>>
>>> we don't want to display a single > if it's a quote of an empty line.
>>> it can get noisy
>>>
>>>
>>> Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
>>> Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/ca537e73
>>> Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/ca537e73
>>> Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/ca537e73
>>>
>>> Branch: refs/heads/master
>>> Commit: ca537e733b6b7096b83ca105a625e5ad1abda110
>>> Parents: 724837d
>>> Author: Daniel Gruno <hu...@apache.org>
>>> Authored: Mon Oct 30 16:13:10 2017 +0100
>>> Committer: Daniel Gruno <hu...@apache.org>
>>> Committed: Mon Oct 30 16:13:10 2017 +0100
>>>
>>> ----------------------------------------------------------------------
>>> site/js/dev/ponymail_email_displays.js | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> ----------------------------------------------------------------------
>>>
>>>
>>> http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/ca537e73/site/js/dev/ponymail_email_displays.js
>>> ----------------------------------------------------------------------
>>> diff --git a/site/js/dev/ponymail_email_displays.js b/site/js/dev/ponymail_email_displays.js
>>> index 913f453..b440399 100644
>>> --- a/site/js/dev/ponymail_email_displays.js
>>> +++ b/site/js/dev/ponymail_email_displays.js
>>> @@ -73,7 +73,7 @@ function displayEmail(json, id, level) {
>>> ebody = "\n" + ebody // add a newline at top
>>> // If we're compacting quotes in the email, let's...do so with some fuzzy logic
>>> if (prefs.compactQuotes == 'yes') {
>>> - ebody = ebody.replace(/((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]+[^\r\n]*\r?\n[^\n]*\n*)+)+)+/mgi, function(inner) {
>>> + ebody = ebody.replace(/((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]*[^\r\n]*\r?\n[^\n]*\n*)+)+)+/mgi, function(inner) {
>>> var rnd = (Math.random() * 100).toString()
>>> inner = inner.replace(/>/g, ">")
>>> var html = "<div class='bs-callout bs-callout-default' style='margin: 3px; padding: 2px;' id='parent_" + rnd + "'>" +
>>>
Re: [4/5] incubator-ponymail git commit: space after a > can be optional
Posted by sebb <se...@gmail.com>.
On 30 October 2017 at 16:29, sebb <se...@gmail.com> wrote:
> This needs a bug report/test messages.
> It looks wrong to me; there must be whitespace after the last >
Or rather, there must be whitespace after > and before any text on the line.
The RE needs to handle the empty line specially.
> On 30 October 2017 at 15:13, <hu...@apache.org> wrote:
>> space after a > can be optional
>>
>> we don't want to display a single > if it's a quote of an empty line.
>> it can get noisy
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/ca537e73
>> Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/ca537e73
>> Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/ca537e73
>>
>> Branch: refs/heads/master
>> Commit: ca537e733b6b7096b83ca105a625e5ad1abda110
>> Parents: 724837d
>> Author: Daniel Gruno <hu...@apache.org>
>> Authored: Mon Oct 30 16:13:10 2017 +0100
>> Committer: Daniel Gruno <hu...@apache.org>
>> Committed: Mon Oct 30 16:13:10 2017 +0100
>>
>> ----------------------------------------------------------------------
>> site/js/dev/ponymail_email_displays.js | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> ----------------------------------------------------------------------
>>
>>
>> http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/ca537e73/site/js/dev/ponymail_email_displays.js
>> ----------------------------------------------------------------------
>> diff --git a/site/js/dev/ponymail_email_displays.js b/site/js/dev/ponymail_email_displays.js
>> index 913f453..b440399 100644
>> --- a/site/js/dev/ponymail_email_displays.js
>> +++ b/site/js/dev/ponymail_email_displays.js
>> @@ -73,7 +73,7 @@ function displayEmail(json, id, level) {
>> ebody = "\n" + ebody // add a newline at top
>> // If we're compacting quotes in the email, let's...do so with some fuzzy logic
>> if (prefs.compactQuotes == 'yes') {
>> - ebody = ebody.replace(/((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]+[^\r\n]*\r?\n[^\n]*\n*)+)+)+/mgi, function(inner) {
>> + ebody = ebody.replace(/((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]*[^\r\n]*\r?\n[^\n]*\n*)+)+)+/mgi, function(inner) {
>> var rnd = (Math.random() * 100).toString()
>> inner = inner.replace(/>/g, ">")
>> var html = "<div class='bs-callout bs-callout-default' style='margin: 3px; padding: 2px;' id='parent_" + rnd + "'>" +
>>
Re: [4/5] incubator-ponymail git commit: space after a > can be optional
Posted by sebb <se...@gmail.com>.
This needs a bug report/test messages.
It looks wrong to me; there must be whitespace after the last >
On 30 October 2017 at 15:13, <hu...@apache.org> wrote:
> space after a > can be optional
>
> we don't want to display a single > if it's a quote of an empty line.
> it can get noisy
>
>
> Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
> Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/ca537e73
> Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/ca537e73
> Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/ca537e73
>
> Branch: refs/heads/master
> Commit: ca537e733b6b7096b83ca105a625e5ad1abda110
> Parents: 724837d
> Author: Daniel Gruno <hu...@apache.org>
> Authored: Mon Oct 30 16:13:10 2017 +0100
> Committer: Daniel Gruno <hu...@apache.org>
> Committed: Mon Oct 30 16:13:10 2017 +0100
>
> ----------------------------------------------------------------------
> site/js/dev/ponymail_email_displays.js | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/ca537e73/site/js/dev/ponymail_email_displays.js
> ----------------------------------------------------------------------
> diff --git a/site/js/dev/ponymail_email_displays.js b/site/js/dev/ponymail_email_displays.js
> index 913f453..b440399 100644
> --- a/site/js/dev/ponymail_email_displays.js
> +++ b/site/js/dev/ponymail_email_displays.js
> @@ -73,7 +73,7 @@ function displayEmail(json, id, level) {
> ebody = "\n" + ebody // add a newline at top
> // If we're compacting quotes in the email, let's...do so with some fuzzy logic
> if (prefs.compactQuotes == 'yes') {
> - ebody = ebody.replace(/((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]+[^\r\n]*\r?\n[^\n]*\n*)+)+)+/mgi, function(inner) {
> + ebody = ebody.replace(/((?:\r?\n)((on .+ wrote:[\r\n]+)|(sent from my .+)|(>+[ \t]*[^\r\n]*\r?\n[^\n]*\n*)+)+)+/mgi, function(inner) {
> var rnd = (Math.random() * 100).toString()
> inner = inner.replace(/>/g, ">")
> var html = "<div class='bs-callout bs-callout-default' style='margin: 3px; padding: 2px;' id='parent_" + rnd + "'>" +
>