Skip to content

Commit 307cdf6

Browse files
committed
knitr, markdown - Add new lines before creating cell output div
Otherwise this is not compatible with Pandoc's Markdown expecting empty new lines before a div
1 parent e14d224 commit 307cdf6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/resources/rmd/hooks.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,11 @@ knitr_hooks <- function(format, resourceDir, handledLanguages) {
407407
if (identical(options[["results"]], "asis") && !needCell) {
408408
x
409409
} else {
410+
# Newline first and after to ensure Pandoc Fenced Div is correctly parsed
410411
paste0(
411-
options[["indent"]], "::: {",
412+
options[["indent"]], "\n::: {",
412413
labelId(label), paste(classes, collapse = " ") ,forwardAttr, "}\n", x, "\n", cell.cap ,
413-
options[["indent"]], ":::"
414+
options[["indent"]], ":::\n"
414415
)
415416
}
416417
})

0 commit comments

Comments
 (0)