From 4a7cfa9bcfec912c276b664440246a94edf84eba Mon Sep 17 00:00:00 2001 From: kartikeya kirar Date: Fri, 15 Sep 2023 11:31:50 +0530 Subject: [PATCH] Update R/Renderer.R MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com> Signed-off-by: kartikeya kirar --- R/Renderer.R | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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())