From d36e4d72f1c08b4165f4e8140462688669d2fe94 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 15 Nov 2024 00:42:14 +0100 Subject: Show hyphen-minus used as minus as mathematical minus in client. --- play.js | 2 ++ rules.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/play.js b/play.js index 90db6bf..e49f6bb 100644 --- a/play.js +++ b/play.js @@ -1093,6 +1093,7 @@ function colorize(text) { text = text.replaceAll("\u2663", colorize_C) text = text.replaceAll("\u2665", colorize_H) text = text.replaceAll("\u2666", colorize_D) + text = text.replace(/-( ?\d)/g, "\u2212$1") return text } @@ -1471,6 +1472,7 @@ function on_log(text) { text = colorize(text) text = text.replace(/S(\d+)/g, sub_space) text = text.replace(/P(\d+)/g, sub_piece) + text = text.replace(/-( ?\d)/g, "\u2212$1") if (text.startsWith("@")) { p.className = "move_tip" diff --git a/rules.js b/rules.js index e73d709..4a31d01 100644 --- a/rules.js +++ b/rules.js @@ -2332,7 +2332,7 @@ function signed_number(v) { if (v > 0) return "+" + v if (v < 0) - return "\u2212" + (-v) + return "-" + (-v) return "0" } -- cgit v1.2.3