Fix html to plain conversion

This commit is contained in:
RainLoop Team 2014-02-25 00:57:34 +04:00
parent fc735e7ea4
commit 82576b3ee2
2 changed files with 8 additions and 6 deletions

View file

@ -2,7 +2,7 @@
"name": "RainLoop",
"title": "RainLoop Webmail",
"version": "1.6.3",
"release": "713",
"release": "715",
"description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net",
"main": "Gruntfile.js",

View file

@ -2,6 +2,9 @@
(function() {
var
$div = $('<div></div>'),
trim = $.trim,
/**
@ -74,22 +77,21 @@
.replace(/<\/blockquote>/gmi, '\n__bq__end__\n')
.replace(/<a [^>]*>([\s\S\r\n]*?)<\/a>/gmi, convertLinks)
.replace(/&nbsp;/gi, ' ')
.replace(/<[^>]*>/gm, '')
.replace(/&gt;/gi, '>')
.replace(/&lt;/gi, '<')
.replace(/&amp;/gi, '&')
.replace(/&#39;/gi, '\'')
.replace(/&#\d{2,5};/gi, '')
.replace(/&\w{2,6};/gi, '')
.replace(/<[^>]*>/gm, '')
;
return sText
sText = sText
.replace(/\n[ \t]+/gm, '\n')
.replace(/[\n]{3,}/gm, '\n\n')
.replace(/__bq__start__([\s\S\r\n]*)__bq__end__/gm, convertBlockquote)
.replace(/__bq__start__/gm, '')
.replace(/__bq__end__/gm, '')
;
return $div.html(sText).text();
},
/**