diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js index 370fcdadf..dd5e058e4 100644 --- a/dev/Common/Utils.js +++ b/dev/Common/Utils.js @@ -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, '>')