Browse Source

allow the `<strong>` tag in `UIAlert`

Nariman Jelveh 1 year ago
parent
commit
aef6df048c
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/UI/UIAlert.js

+ 7 - 1
src/UI/UIAlert.js

@@ -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;">`;