Skip to content

Commit

Permalink
Fix error when highlighting JSON output (#32)
Browse files Browse the repository at this point in the history
* Ensure strings containing something other than `\w` are matched

* Match color for `null` with booleans
  • Loading branch information
alejandrohdezma authored Feb 22, 2021
1 parent 23d97e3 commit a9dbba4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ abstract class HttpFromContainerSuite
if (munitAnsiColors)
json
.replaceAll("""(\"\w+\") : """, Console.CYAN + "$1" + Console.RESET + " : ")
.replaceAll(""" : (\"\w+\")""", " : " + Console.YELLOW + "$1" + Console.RESET)
.replaceAll(""" : (\".*\")""", " : " + Console.YELLOW + "$1" + Console.RESET)
.replaceAll(""" : (\d+)""", " : " + Console.GREEN + "$1" + Console.RESET)
.replaceAll(""" : true""", " : " + Console.MAGENTA + "true" + Console.RESET)
.replaceAll(""" : false""", " : " + Console.MAGENTA + "false" + Console.RESET)
.replaceAll(""" : null""", " : " + Console.MAGENTA + "null" + Console.RESET)
else json
)

Expand Down

0 comments on commit a9dbba4

Please sign in to comment.