Skip to content

Commit

Permalink
fix: overlayer(webpack#3579)
Browse files Browse the repository at this point in the history
  • Loading branch information
githoniel committed Aug 9, 2021
1 parent f663deb commit 376f0b5
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 17,894 deletions.
7 changes: 4 additions & 3 deletions client-src/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// They, in turn, got inspired by webpack-hot-middleware (https://github.com/glenjamin/webpack-hot-middleware).

const ansiHTML = require("ansi-html");
const { encode } = require("html-entities");

const colors = {
reset: ["transparent", "transparent"],
Expand Down Expand Up @@ -135,16 +136,16 @@ function show(messages, type) {

// Make it look similar to our terminal.
const errorMessage = message.message || messages[0];
const text = ansiHTML(errorMessage);
const messageTextNode = document.createTextNode(text);
const text = ansiHTML(encode(errorMessage));
const messageTextNode = document.createElement("div");
messageTextNode.innerHTML = text;

entryElement.appendChild(typeElement);
entryElement.appendChild(document.createElement("br"));
entryElement.appendChild(document.createElement("br"));
entryElement.appendChild(messageTextNode);
entryElement.appendChild(document.createElement("br"));
entryElement.appendChild(document.createElement("br"));
entryElement.appendChild(document.createElement("br"));

containerElement.appendChild(entryElement);
});
Expand Down
Loading

0 comments on commit 376f0b5

Please sign in to comment.