Output raw markdown in Quarto document from R #13504
Replies: 2 comments
-
In Quarto, you should have nothing inside the brackets except the language. I'm not sure the issue is Quarto. ---
title: "Reproducible Quarto Document"
format: html
engine: knitr
keep-md: true
---
```{r}
#| output: asis
cat(paste0("|- test\n|test"))
```
---
```{r}
#| results: asis
cat(paste0("|- test\n|test"))
```
From this code, regardless of the chosen format, Quarto produces the following intermediate Markdown document: ---
title: "Reproducible Quarto Document"
format: gfm
engine: knitr
keep-md: true
---
```{.r .cell-code}
cat(paste0("|- test\n|test"))
```
|- test
|test
---
```{.r .cell-code}
cat(paste0("|- test\n|test"))
```
|- test
|test Then if you use Pandoc on this intermediate document: quarto pandoc --from markdown --to markdown index.html.md You get exactly what you see. Note that the behaviour is normal. Here the quarto pandoc --from markdown --to markdown-pipe_tables index.html.md I don't know what you are trying to emit exactly but the issue might be there. |
Beta Was this translation helpful? Give feedback.
-
When you want to write raw markdown that are not supposed to be parsed, but output asis in the output document, one solution is to mark it as a raw block like you would do with HTML or LaTeX ---
title: "Reproducible Quarto Document"
format: markdown
engine: knitr
---
```{r}
#| output: asis
knitr::raw_block(paste0("|- test\n|test"), "markdown")
``` and here this would be necessary as |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I am trying to output raw markdown from an R function in a Quarto document, but it seems that some escaping is applied.
When
quarto render test.qmd -t markdown
this is the output:While the expected output should be:
Is there a way of getting text to be output as is from a Quarto markdown? Might be related to #6874?
Beta Was this translation helpful? Give feedback.
All reactions