# Create a reprex of lightparser failure. Key issue seems to be the call to
# system.file() within the chunk options area. (In my real code, the call to
# system.file() is much longer and pulls up a text file from a package.) Remove
# `, child = system.file()` and this code will work.
library(lightparser)
bad_file <- "---\ntitle: Example\n---\n\n```{r, child = system.file()}\n```\n"
in_file <- tempfile(fileext = ".Rmd")
writeLines(bad_file, in_file)
x <- split_to_tbl(in_file)
#> It seems you are currently knitting a Rmd/Qmd file. The parsing of the file will be done in a new R session.
file_out <- tempfile(fileext = ".Rmd")
out <- combine_tbl_to_file(x, file_out)
#> Error in yaml::as.yaml(other_params): Unknown emitter error
Created on 2024-02-05 with reprex v2.0.2
Created on 2024-02-05 with reprex v2.0.2