From 57f07cf6b67c47857cf1ccbb9c3ec6f198849170 Mon Sep 17 00:00:00 2001 From: Fayti1703 Date: Fri, 10 Apr 2026 15:45:16 +0200 Subject: [PATCH] Fix negative numbers not KVP autocoloring --- src/plugins/rehype/autocolor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/rehype/autocolor.js b/src/plugins/rehype/autocolor.js index dc174bb5..0f2a307c 100644 --- a/src/plugins/rehype/autocolor.js +++ b/src/plugins/rehype/autocolor.js @@ -39,7 +39,7 @@ const regexColorTag = /%([0-9a-zA-z])(.+?)%/g; // Values can be strings, numbers, null, true, false, or scriptors // This will also match : { or : [ but will NOT include the { or [ in the match to be colorized const regexKvp = - /(\w+|".*?")[ ]*:[ ]*(?:(".*?"|\d+(?:\.\d*)?|null|true|false|#s\.\w+\.\w+)|(?=\{|\[))/g; + /(\w+|".*?")[ ]*:[ ]*(?:(".*?"|-?\d+(?:\.\d*)?|null|true|false|#s\.\w+\.\w+)|(?=\{|\[))/g; // Matches GC strings, e.g. 1Q1T1B1M1K1GC // Explicitly does NOT match the text GC on its own