From 2828d13e3a1e57f5aa3758ba4112b7ce9d491c14 Mon Sep 17 00:00:00 2001 From: John Doty Date: Mon, 28 Oct 2024 06:01:27 -0700 Subject: [PATCH] [dingus] More legible errors --- dingus/dingus.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dingus/dingus.js b/dingus/dingus.js index 7aab450..d019ac6 100644 --- a/dingus/dingus.js +++ b/dingus/dingus.js @@ -88,7 +88,7 @@ function render_state(state, input_editor) { } if (state.output_mode === "errors") { - const error_node = document.createElement("pre"); + const error_node = document.createElement("div"); error_node.classList.add("error-panel"); if (state.errors.length == 0) { if (state.tree) { @@ -97,7 +97,13 @@ function render_state(state, input_editor) { error_node.innerText = "No errors."; } } else { - error_node.innerText = state.errors.join("\n"); + const ul = document.createElement("ul"); + ul.replaceChildren(...state.errors.map(e => { + const li = document.createElement("li"); + li.innerText = e; + return li; + })); + error_node.appendChild(ul); } OUTPUT.replaceChildren(error_node);