cli icon indicating copy to clipboard operation
cli copied to clipboard

newlines in code formatted text throws error

Open zkamvar opened this issue 2 years ago • 0 comments

My package uses cli to pass the output of a modified call to the user, which often has arguments wrapping to the next line. Version 3.2.0 now throws an error on newlines within {.code } formatted text:

cli::cli_text("{.code a & b}")
#> `a & b`
cli::cli_text("{.code a &\nb}")
#> Error in vapply(X, FUN, FUN.VALUE = character(1), ..., USE.NAMES = USE.NAMES): values must be length 1,
#>  but FUN(X[[1]]) result is length 2

Created on 2022-02-14 by the reprex package (v2.0.1)

zkamvar avatar Feb 14 '22 17:02 zkamvar