This splits the output by opening/closing styling. In the first two examples, only the backslash is colored red. In the third example, \n is colored red.
@patperry: Is this intentional? Should we consistently color all characters in \" and \\ in red?
utf8::utf8_encode(c("\\", '"', "\n"), quote = TRUE, escapes = "31", display = TRUE) |>
strsplit("\033[[][^m]*m")
#> [[1]]
#> [1] "\"" "\\" "\\\""
#>
#> [[2]]
#> [1] "\"" "\\" "\"\""
#>
#> [[3]]
#> [1] "\"" "\\n" "\""
Created on 2022-06-30 by the reprex package (v2.0.1)
This splits the output by opening/closing styling. In the first two examples, only the backslash is colored red. In the third example,
\nis colored red.@patperry: Is this intentional? Should we consistently color all characters in
\"and\\in red?Created on 2022-06-30 by the reprex package (v2.0.1)