mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +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,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…
Add table
Add a link
Reference in a new issue