Improve fcn_sanitizeHTML()

This commit is contained in:
Tetrakern 2024-10-22 18:06:50 +02:00
parent 1575442482
commit cf8ef67497
3 changed files with 4 additions and 3 deletions

4
js/complete.min.js vendored

File diff suppressed because one or more lines are too long

2
js/utility.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -802,6 +802,7 @@ function fcn_sanitizeHTML(html) {
const temp = document.createElement('div'); const temp = document.createElement('div');
temp.innerText = html instanceof HTMLElement ? html.innerHTML : html; temp.innerText = html instanceof HTMLElement ? html.innerHTML : html;
temp.textContent = typeof html === 'string' ? html : html.textContent;
return temp.innerHTML; return temp.innerHTML;
} }