From 6416d8649a057e3383114fb9c88c0be343366095 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 2 Jun 2024 13:40:07 +0200 Subject: Add on_prompt callback for styling prompt text as HTML. --- public/common/client.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/common/client.js b/public/common/client.js index 367cbb0..229f8ae 100644 --- a/public/common/client.js +++ b/public/common/client.js @@ -581,7 +581,10 @@ let is_your_turn = false let old_active = null function on_update_header() { - document.getElementById("prompt").textContent = view.prompt + if (typeof on_prompt === "function") + document.getElementById("prompt").innerHTML = on_prompt(view.prompt) + else + document.getElementById("prompt").textContent = view.prompt if (params.mode === "replay") return if (snap_view) -- cgit v1.2.3