Skip to content

Failure in the case of a function call within the code options area #4

@davidkane9

Description

@davidkane9
# 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions