Fix toast._show was not showing html text correctly

This commit is contained in:
Bofh 2022-12-13 01:14:09 +01:00
parent a5c9f07f2e
commit ceefa2a363
1 changed files with 3 additions and 0 deletions

View File

@ -294,6 +294,9 @@ const toast = {
div.id = id; div.id = id;
div.className = 'toast-container'; div.className = 'toast-container';
div.setAttribute('onclick', 'this.remove()'); div.setAttribute('onclick', 'this.remove()');
text = text.replaceAll('&','&amp;').replaceAll('<','&lt;').replaceAll('>','&gt;');
text = html2text(text);
text = text.replaceAll('&','&amp;').replaceAll('<','&lt;').replaceAll('>','&gt;');
div.innerHTML = '<div class="toast '+type+'"><p style="margin: auto 0 !important;font-size: 1.2em;line-height: 1.8em;">'+ div.innerHTML = '<div class="toast '+type+'"><p style="margin: auto 0 !important;font-size: 1.2em;line-height: 1.8em;">'+
'<i style="margin-right: 1em;font-size: 1.2em;position:relative;top:.1em" class="fa fa-'+fa+'"></i>'+capitalize(text)+'</p></div>'; '<i style="margin-right: 1em;font-size: 1.2em;position:relative;top:.1em" class="fa fa-'+fa+'"></i>'+capitalize(text)+'</p></div>';
if (document.getElementById('toast-container') !== null) if (document.getElementById('toast-container') !== null)