Browse Source

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

Replaces html special characters with html entities
MrCrayon 7 months ago
parent
commit
02f4f3f4d3
1 changed files with 3 additions and 0 deletions
  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);
                     })