Simplify to vector when parsing json message for R #3938
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So that we get vector instead of unnamed list as e.g some knitr options expect vector. This closes #3909
Context
Setting multiple for
devwas not workingbecause Quarto parses the YAML then pass it to the R process using JSON message that is parsed with jsonlite but
knitr$opts_chunk$devis seen as a unamed list and not coerced to a vector.This creates issue within knitr which expect a vector for some options and currently does not handle or coerce list to vector itself.
I believe that YAML parsing does correctly see this as a vector, so it seems ok to simplify when parsing the JSON.
This will also convert to Matrix and Dataframe in some case - if we want to prevent that we could do
but seems too much.
If this is too broad fix anyway, We could simplify only the
knitrfields in the message.;BTW I tried to add a test using the new smoke-all folder - Hopefully adding a file is enough for it to be run.