allow the <strong> tag in UIAlert

This commit is contained in:
Nariman Jelveh
2024-04-23 23:06:04 -07:00
parent f8b2b18185
commit aef6df048c

View File

@@ -46,11 +46,17 @@ function UIAlert(options){
if(options.type === 'success')
options.body_icon = window.icons['c-check.svg'];
let santized_message = html_encode(options.message);
// replace sanitized <strong> with <strong>
santized_message = santized_message.replace(/&lt;strong&gt;/g, '<strong>');
santized_message = santized_message.replace(/&lt;\/strong&gt;/g, '</strong>');
let h = '';
// icon
h += `<img class="window-alert-icon" src="${html_encode(options.body_icon)}">`;
// message
h += `<div class="window-alert-message">${html_encode(options.message)}</div>`;
h += `<div class="window-alert-message">${santized_message}</div>`;
// buttons
if(options.buttons && options.buttons.length > 0){
h += `<div style="overflow:hidden; margin-top:20px;">`;