Browse Source

Fixes html content not showing in received response (#890)

Replaces html special characters with html entities
MrCrayon 8 tháng trước cách đây
mục cha
commit
02f4f3f4d3
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      resources/views/themes/elements/index.blade.php

+ 3 - 0
resources/views/themes/elements/index.blade.php

@@ -137,6 +137,9 @@
                             }
                         } catch (e) {}
 
+                        // Replace HTML entities
+                        responseContent = responseContent.replace(/[<>&]/g, (i) => '&#' + i.charCodeAt(0) + ';');
+
                         contentEl.innerHTML = responseContent;
                         isJson && window.hljs.highlightElement(contentEl);
                     })