From 843b186354462db4e8ff3805904296df64905a7e Mon Sep 17 00:00:00 2001 From: djmaze Date: Tue, 22 Sep 2020 14:23:31 +0200 Subject: [PATCH] Use HTMLTemplateElement --- dev/Common/Utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, '>')