ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Gruno <humbed...@apache.org>
Subject Re: incubator-ponymail git commit: Better handling of quoted text - fixes #213
Date Thu, 27 Oct 2016 10:16:11 GMT
Just as an FWIW, we have a much cleaner and safer method for this in the
coffee-and-cake branch, that doesn't involve escaping or raw HTML. If
you could change it there as well, that'd be helpful as it's slated to
replace the current JS eventually (when time permits, *sigh*).

With regards,
Daniel.

On 10/27/2016 12:14 PM, sebb@apache.org wrote:
> Repository: incubator-ponymail
> Updated Branches:
>   refs/heads/master 69b23dd22 -> d22f74422
> 
> 
> Better handling of quoted text - fixes #213
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
> Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/d22f7442
> Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/d22f7442
> Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/d22f7442
> 
> Branch: refs/heads/master
> Commit: d22f74422173d2a88babd7c1b800b321ee6ba57a
> Parents: 69b23dd
> Author: Sebb <sebb@apache.org>
> Authored: Thu Oct 27 11:14:12 2016 +0100
> Committer: Sebb <sebb@apache.org>
> Committed: Thu Oct 27 11:14:12 2016 +0100
> 
> ----------------------------------------------------------------------
>  site/js/dev/ponymail_email_displays.js | 4 ++--
>  site/js/ponymail.js                    | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/d22f7442/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 4df138f..1ea580e 100644
> --- a/site/js/dev/ponymail_email_displays.js
> +++ b/site/js/dev/ponymail_email_displays.js
> @@ -82,7 +82,7 @@ function displayEmail(json, id, level) {
>          base = base.replace(/\/+/g, "/")
>          // 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, "&gt;")
>                  var html = "<div class='bs-callout bs-callout-default' style='margin:
3px; padding: 2px;' id='parent_" + rnd + "'>" +
> @@ -266,7 +266,7 @@ function displaySingleEmail(json, id) {
>          var base = pm_config.URLBase ? pm_config.URLBase : ""
>          base = base.replace(/\/+/g, "/")
>          if (true) {
> -            ebody = ebody.replace(/(?:\r?\n)((>+[ \t]*[^\r\n]*\r?\n+)+)/mg, function(inner)
{
> +            ebody = ebody.replace(/(?:\r?\n)((>+[ \t]+[^\r\n]*\r?\n+)+)/mg, function(inner)
{
>                  var rnd = (Math.random() * 100).toString()
>                  var html = "<div class='bs-callout bs-callout-default' style='padding:
2px;' id='parent_" + rnd + "'>" +
>                      "<img src='" + base + "/images/quote.png' title='show/hide original
text' onclick='toggleView(\"quote_" + rnd + "\")'/><br/>" +
> 
> http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/d22f7442/site/js/ponymail.js
> ----------------------------------------------------------------------
> diff --git a/site/js/ponymail.js b/site/js/ponymail.js
> index 509f9ec..7368645 100644
> --- a/site/js/ponymail.js
> +++ b/site/js/ponymail.js
> @@ -1428,7 +1428,7 @@ function displayEmail(json, id, level) {
>          base = base.replace(/\/+/g, "/")
>          // 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, "&gt;")
>                  var html = "<div class='bs-callout bs-callout-default' style='margin:
3px; padding: 2px;' id='parent_" + rnd + "'>" +
> @@ -1612,7 +1612,7 @@ function displaySingleEmail(json, id) {
>          var base = pm_config.URLBase ? pm_config.URLBase : ""
>          base = base.replace(/\/+/g, "/")
>          if (true) {
> -            ebody = ebody.replace(/(?:\r?\n)((>+[ \t]*[^\r\n]*\r?\n+)+)/mg, function(inner)
{
> +            ebody = ebody.replace(/(?:\r?\n)((>+[ \t]+[^\r\n]*\r?\n+)+)/mg, function(inner)
{
>                  var rnd = (Math.random() * 100).toString()
>                  var html = "<div class='bs-callout bs-callout-default' style='padding:
2px;' id='parent_" + rnd + "'>" +
>                      "<img src='" + base + "/images/quote.png' title='show/hide original
text' onclick='toggleView(\"quote_" + rnd + "\")'/><br/>" +
> 


Mime
View raw message