mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 23:08:08 +08:00
Use HTMLTemplateElement
This commit is contained in:
parent
d2c9e860cb
commit
843b186354
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@ import { Mime } from 'Common/Mime';
|
|||
|
||||
const
|
||||
doc = document,
|
||||
tpl = doc.createElement('div'),
|
||||
tpl = doc.createElement('template'),
|
||||
isArray = Array.isArray,
|
||||
htmlmap = {
|
||||
'&': '&',
|
||||
|
@ -406,7 +406,7 @@ export function htmlToPlain(html) {
|
|||
.replace(/"/gi, '"')
|
||||
.replace(/<[^>]*>/gm, '');
|
||||
|
||||
text = splitPlainText(tpl.textContent
|
||||
text = splitPlainText(tpl.innerText
|
||||
.replace(/\n[ \t]+/gm, '\n')
|
||||
.replace(/[\n]{3,}/gm, '\n\n')
|
||||
.replace(/>/gi, '>')
|
||||
|
|
Loading…
Reference in a new issue