mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03: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",
|
"name": "RainLoop",
|
||||||
"title": "RainLoop Webmail",
|
"title": "RainLoop Webmail",
|
||||||
"version": "1.6.3",
|
"version": "1.6.3",
|
||||||
"release": "713",
|
"release": "715",
|
||||||
"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": "Gruntfile.js",
|
"main": "Gruntfile.js",
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
var
|
var
|
||||||
|
|
||||||
|
$div = $('<div></div>'),
|
||||||
|
|
||||||
trim = $.trim,
|
trim = $.trim,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -74,22 +77,21 @@
|
||||||
.replace(/<\/blockquote>/gmi, '\n__bq__end__\n')
|
.replace(/<\/blockquote>/gmi, '\n__bq__end__\n')
|
||||||
.replace(/<a [^>]*>([\s\S\r\n]*?)<\/a>/gmi, convertLinks)
|
.replace(/<a [^>]*>([\s\S\r\n]*?)<\/a>/gmi, convertLinks)
|
||||||
.replace(/ /gi, ' ')
|
.replace(/ /gi, ' ')
|
||||||
.replace(/<[^>]*>/gm, '')
|
|
||||||
.replace(/>/gi, '>')
|
.replace(/>/gi, '>')
|
||||||
.replace(/</gi, '<')
|
.replace(/</gi, '<')
|
||||||
.replace(/&/gi, '&')
|
.replace(/&/gi, '&')
|
||||||
.replace(/'/gi, '\'')
|
.replace(/<[^>]*>/gm, '')
|
||||||
.replace(/&#\d{2,5};/gi, '')
|
|
||||||
.replace(/&\w{2,6};/gi, '')
|
|
||||||
;
|
;
|
||||||
|
|
||||||
return sText
|
sText = sText
|
||||||
.replace(/\n[ \t]+/gm, '\n')
|
.replace(/\n[ \t]+/gm, '\n')
|
||||||
.replace(/[\n]{3,}/gm, '\n\n')
|
.replace(/[\n]{3,}/gm, '\n\n')
|
||||||
.replace(/__bq__start__([\s\S\r\n]*)__bq__end__/gm, convertBlockquote)
|
.replace(/__bq__start__([\s\S\r\n]*)__bq__end__/gm, convertBlockquote)
|
||||||
.replace(/__bq__start__/gm, '')
|
.replace(/__bq__start__/gm, '')
|
||||||
.replace(/__bq__end__/gm, '')
|
.replace(/__bq__end__/gm, '')
|
||||||
;
|
;
|
||||||
|
|
||||||
|
return $div.html(sText).text();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue