Skip to content

Commit 007fd54

Browse files
authored
Fix negative numbers not KVP autocoloring (#594)
1 parent 466b761 commit 007fd54

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/plugins/rehype/autocolor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const regexColorTag = /%([0-9a-zA-z])(.+?)%/g;
3939
// Values can be strings, numbers, null, true, false, or scriptors
4040
// This will also match <key>: { or <key>: [ but will NOT include the { or [ in the match to be colorized
4141
const regexKvp =
42-
/(\w+|".*?")[ ]*:[ ]*(?:(".*?"|\d+(?:\.\d*)?|null|true|false|#s\.\w+\.\w+)|(?=\{|\[))/g;
42+
/(\w+|".*?")[ ]*:[ ]*(?:(".*?"|-?\d+(?:\.\d*)?|null|true|false|#s\.\w+\.\w+)|(?=\{|\[))/g;
4343

4444
// Matches GC strings, e.g. 1Q1T1B1M1K1GC
4545
// Explicitly does NOT match the text GC on its own

0 commit comments

Comments
 (0)