diff --git a/app/error-handler.js b/app/error-handler.js index 30f77068..ecfb2b0d 100644 --- a/app/error-handler.js +++ b/app/error-handler.js @@ -6,16 +6,6 @@ (function(){ "use strict"; - function convertNewlines(msg, parentElem) { - const lines = msg.split("\n"); - lines.forEach(function (line) { - parentElem.appendChild(document.createElement("br")); - parentElem.appendChild(document.createTextNode(line)); - }); - parentElem.removeChild(parentElem.firstChild); - return parentElem; - } - // Fallback for all uncought errors function handleError (event, err) { try { @@ -28,7 +18,7 @@ var div = document.createElement("div"); div.classList.add('noVNC_message'); - convertNewlines(event.message, div); + div.appendChild(document.createTextNode(event.message)); msg.appendChild(div); if (event.filename !== undefined && event.lineno !== undefined && event.colno !== undefined) { diff --git a/app/styles/base.css b/app/styles/base.css index 62a06287..f7c5de4b 100644 --- a/app/styles/base.css +++ b/app/styles/base.css @@ -231,7 +231,6 @@ select:active { text-align: center; font-weight: bold; - word-wrap: break-word; color: #fff; border-radius: 10px; @@ -251,6 +250,8 @@ select:active { #noVNC_fallback_errormsg .noVNC_message { display: inline-block; text-align: left; + font-family: monospace; + white-space: pre-wrap; } #noVNC_fallback_error .noVNC_location { @@ -264,7 +265,8 @@ select:active { margin: 10px; font-size: 0.8em; text-align: left; - white-space: pre; + font-family: monospace; + white-space: pre-wrap; border: 1px solid rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.2); }