mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-03-06 11:49:32 +08:00
Fix html to plain conversion
This commit is contained in:
parent
fc735e7ea4
commit
82576b3ee2
2 changed files with 8 additions and 6 deletions
|
@ -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",
|
||||
|
|
|
@ -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(/ /gi, ' ')
|
||||
.replace(/<[^>]*>/gm, '')
|
||||
.replace(/>/gi, '>')
|
||||
.replace(/</gi, '<')
|
||||
.replace(/&/gi, '&')
|
||||
.replace(/'/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();
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue