Don't try to escape or encode html when the null

This commit is contained in:
Niko 2022-02-14 02:39:53 +01:00
parent adff18f54d
commit 67601001c1
1 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,8 @@ function isVisible(element) {
}
function html2text(html) {
if (html === undefined || html === null)
return undefined;
var e = document.createElement('div');
e.innerHTML = html;
const result = e.innerText;
@ -18,6 +20,8 @@ function html2text(html) {
}
function htmlescape(html) {
if (html === undefined || html === null)
return undefined;
var e = document.createElement('div');
e.innerText = html;
const result = e.innerHTML;