This is super weird and it took me a long time to find a minimal-ish example. But this is happening to me in real life, where I am using parsermd on the .Rmd files in the R Packages book. This defines a character vector of some lines:
lines <- glue::glue("
```{r toplevel}
# comment following an empty line
goo <- function() {
1 + 1
# comment following an empty line
}
List item
foo <- function() {
1 + 1
# comment following an empty line
}
```",
.open = "<<", .close = ">>")
If I write lines to file, it's valid .Rmd and it can be rendered. But parsermd can't parse it. AFAICT the problem seems to be this specific combination:
A code chunk inside a bullet list
Inside a function body (?), a comment right after an empty line
This is super weird and it took me a long time to find a minimal-ish example. But this is happening to me in real life, where I am using parsermd on the
.Rmd
files in the R Packages book. This defines a character vector of somelines
:List item
If I write
lines
to file, it's valid.Rmd
and it can be rendered. But parsermd can't parse it. AFAICT the problem seems to be this specific combination: