chg: [js-utils:sanitize] Added sanitization function

develop-unstable
Sami Mokaddem 2023-02-16 13:30:54 +01:00
parent 03b6de68e1
commit d2003d45d6
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 6 additions and 0 deletions

View File

@ -200,4 +200,10 @@ function download(filename, data, type='application/json') {
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(objectURL)
}
function sanitize(unsafeText) {
const decoder = $('<div>')
decoder.text(unsafeText)
return decoder.html()
}