Closed pensivedog closed 2 years ago
That's a basic Markdown feature: https://pandoc.org/MANUAL.html#indented-code-blocks
If you have pure raw HTML code, you can use the raw attribute: https://bookdown.org/yihui/rmarkdown-cookbook/raw-content.html But your problem is that you want to have both raw HTML and R code chunks, so you can't wrap everything into ````{=html}
. It might work if you split the block into three pieces: raw HTML, R code chunk, and raw HTML. Then mark the two pieces of raw HTML as raw content separately.
Not being able to indent nested html elements makes this much more difficult to manage.
I don't quite understand how much more difficult it would be without indenting. As long as you don't indent by four or more spaces, it should be fine, e.g., you can indent by up to three spaces:
<section class="section">
<div class="container">
<div class="row">
<div class="col">
```{r cars}
summary(cars)
This is so helpful. Thank you for the explanation!
I'm trying to add some custom html elements and classes in an .Rmd file, as follows: