mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +03: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
|
const
|
||||||
doc = document,
|
doc = document,
|
||||||
tpl = doc.createElement('div'),
|
tpl = doc.createElement('template'),
|
||||||
isArray = Array.isArray,
|
isArray = Array.isArray,
|
||||||
htmlmap = {
|
htmlmap = {
|
||||||
'&': '&',
|
'&': '&',
|
||||||
|
|
@ -406,7 +406,7 @@ export function htmlToPlain(html) {
|
||||||
.replace(/"/gi, '"')
|
.replace(/"/gi, '"')
|
||||||
.replace(/<[^>]*>/gm, '');
|
.replace(/<[^>]*>/gm, '');
|
||||||
|
|
||||||
text = splitPlainText(tpl.textContent
|
text = splitPlainText(tpl.innerText
|
||||||
.replace(/\n[ \t]+/gm, '\n')
|
.replace(/\n[ \t]+/gm, '\n')
|
||||||
.replace(/[\n]{3,}/gm, '\n\n')
|
.replace(/[\n]{3,}/gm, '\n\n')
|
||||||
.replace(/>/gi, '>')
|
.replace(/>/gi, '>')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue