Skip to content

Commit 44b6a76

Browse files
committed
Escape { } in cli message
1 parent c67fab5 commit 44b6a76

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

R/quarto.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ wrap_quarto_error <- function(cnd, args, .call = rlang::caller_env()) {
351351
msg <- c(
352352
msg,
353353
" " = paste0(rep("-", nchar(msg)), collapse = ""),
354-
quarto_error_msg
354+
cli_escape(quarto_error_msg)
355355
)
356356
}
357357

R/utils.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ warn_or_error <- function(message, ..., .envir = parent.frame()) {
162162
}
163163
}
164164

165+
cli_escape <- function(x) {
166+
x <- gsub("{", "{{", x, fixed = TRUE)
167+
x <- gsub("}", "}}", x, fixed = TRUE)
168+
x
169+
}
170+
165171
# inline knitr:::merge_list()
166172
merge_list <- function(x, y) {
167173
x[names(y)] <- y

0 commit comments

Comments
 (0)