From 72ed59d61d1c5e9f16e2f89f0b574bd7339e546f Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Mon, 14 Oct 2024 15:32:25 +0200 Subject: [PATCH] Update ErrorMessage.js --- frontend/components/ErrorMessage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/components/ErrorMessage.js b/frontend/components/ErrorMessage.js index 8e19cc3fc..42cd688f9 100644 --- a/frontend/components/ErrorMessage.js +++ b/frontend/components/ErrorMessage.js @@ -288,7 +288,10 @@ const AnsiUpLine = (/** @type {{value: string}} */ { value }) => { node_ref.current.innerHTML = new AnsiUp().ansi_to_html(value) }, [node_ref.current, value]) - return value === "" ? html`


` : html`

` + // placeholder while waiting for AnsiUp to render, to prevent layout flash + const without_ansi_chars = value.replace(/\u001b\[[0-9;]*m/g, "") + + return value === "" ? html`


` : html`

${without_ansi_chars}

` } export const ErrorMessage = ({ msg, stacktrace, cell_id }) => { @@ -559,7 +562,7 @@ const motivational_words = [ "Be patient :)", // Errors horen erbij // Ook de pros krijgen errors - ...Array(30).fill(null), + ...Array(100).fill(null), ] const Motivation = ({ stacktrace }) => {