diff --git a/R/Renderer.R b/R/Renderer.R index bb691e22..5cee3cdb 100644 --- a/R/Renderer.R +++ b/R/Renderer.R @@ -120,14 +120,17 @@ Renderer <- R6::R6Class( # nolint: object_name_linter. params <- block$get_params() params <- lapply(params, function(l) if (is.character(l)) shQuote(l) else l) block_content <- block$get_content() - paste("### ", - sprintf( - "\n```{r, %s}\n%s\n```\n", - paste(names(params), params, sep = "=", collapse = ", "), - block_content - ), - collapse = "\n" - ) + paste( + sep = "\n", + collapse = "\n", + "### ", + sprintf( + "```{r, %s}", paste(names(params), params, sep = "=", collapse = ", ") + ), + block_content, + "```", + "" + ) }, pictureBlock2md = function(block) { basename_pic <- basename(block$get_content())