Sfoglia il codice sorgente

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

Replaces html special characters with html entities
MrCrayon 8 mesi fa
parent
commit
02f4f3f4d3
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  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);
                     })