Small fixes

Release commit
This commit is contained in:
RainLoop Team 2014-08-14 23:05:54 +04:00
parent ff7b71fd6c
commit 5d6ca00687
6 changed files with 25 additions and 10 deletions

View file

@ -1676,6 +1676,10 @@ Utils.htmlToPlain = function (sHtml)
return ''; return '';
}, },
convertPre = function () {
return (arguments && 1 < arguments.length) ? arguments[1].toString().replace(/[\n]/gm, '<br />') : '';
},
fixAttibuteValue = function () { fixAttibuteValue = function () {
return (arguments && 1 < arguments.length) ? return (arguments && 1 < arguments.length) ?
'' + arguments[1] + arguments[2].replace(/</g, '&lt;').replace(/>/g, '&gt;') : ''; '' + arguments[1] + arguments[2].replace(/</g, '&lt;').replace(/>/g, '&gt;') : '';
@ -1687,6 +1691,7 @@ Utils.htmlToPlain = function (sHtml)
; ;
sText = sHtml sText = sHtml
.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gmi, convertPre)
.replace(/[\s]+/gm, ' ') .replace(/[\s]+/gm, ' ')
.replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue) .replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue)
.replace(/<br[^>]*>/gmi, '\n') .replace(/<br[^>]*>/gmi, '\n')

View file

@ -2,7 +2,7 @@
"name": "RainLoop", "name": "RainLoop",
"title": "RainLoop Webmail", "title": "RainLoop Webmail",
"version": "1.6.8", "version": "1.6.8",
"release": "155", "release": "156",
"description": "Simple, modern & fast web-based email client", "description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net", "homepage": "http://rainloop.net",
"main": "gulpfile.js", "main": "gulpfile.js",

View file

@ -2475,6 +2475,10 @@ Utils.htmlToPlain = function (sHtml)
return ''; return '';
}, },
convertPre = function () {
return (arguments && 1 < arguments.length) ? arguments[1].toString().replace(/[\n]/gm, '<br />') : '';
},
fixAttibuteValue = function () { fixAttibuteValue = function () {
return (arguments && 1 < arguments.length) ? return (arguments && 1 < arguments.length) ?
'' + arguments[1] + arguments[2].replace(/</g, '&lt;').replace(/>/g, '&gt;') : ''; '' + arguments[1] + arguments[2].replace(/</g, '&lt;').replace(/>/g, '&gt;') : '';
@ -2486,6 +2490,7 @@ Utils.htmlToPlain = function (sHtml)
; ;
sText = sHtml sText = sHtml
.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gmi, convertPre)
.replace(/[\s]+/gm, ' ') .replace(/[\s]+/gm, ' ')
.replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue) .replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue)
.replace(/<br[^>]*>/gmi, '\n') .replace(/<br[^>]*>/gmi, '\n')

File diff suppressed because one or more lines are too long

View file

@ -2478,6 +2478,10 @@ Utils.htmlToPlain = function (sHtml)
return ''; return '';
}, },
convertPre = function () {
return (arguments && 1 < arguments.length) ? arguments[1].toString().replace(/[\n]/gm, '<br />') : '';
},
fixAttibuteValue = function () { fixAttibuteValue = function () {
return (arguments && 1 < arguments.length) ? return (arguments && 1 < arguments.length) ?
'' + arguments[1] + arguments[2].replace(/</g, '&lt;').replace(/>/g, '&gt;') : ''; '' + arguments[1] + arguments[2].replace(/</g, '&lt;').replace(/>/g, '&gt;') : '';
@ -2489,6 +2493,7 @@ Utils.htmlToPlain = function (sHtml)
; ;
sText = sHtml sText = sHtml
.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gmi, convertPre)
.replace(/[\s]+/gm, ' ') .replace(/[\s]+/gm, ' ')
.replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue) .replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gmi, fixAttibuteValue)
.replace(/<br[^>]*>/gmi, '\n') .replace(/<br[^>]*>/gmi, '\n')

File diff suppressed because one or more lines are too long