Example from https://github.com/quarto-dev/quarto-cli/discussions/5813

This below won't work 
````markdown
---
format: html
---

```{r}
#| tidy: true
#| tidy-opts: !expr list(width.cutoff = 50)
# a long expression
1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+
1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
```
````

This is because 

* knitr defines `tidy.opts = NULL` as a default
* knitr will parse the YAML chunk option and sees `tidy-opts` so it won't replace the default. Options have both now `tidy-opts` and `tidy.opts`
* Quarto will normalize `-` to `.` in an option hook step, but this will just rename. This means options in knitr have twice `tidy.opts` with two different value. 
* Knitr will use only the first value, which will be the default one. 

Our options hooks should make the replacement. 

Longer term, **knitr** should probably do the normalization as the YAML chunk option parsing step

https://github.com/quarto-dev/quarto-cli/blob/5df9451723c7fe81462700c19709c0b06846de95/src/resources/rmd/hooks.R#L11-L18

https://github.com/quarto-dev/quarto-cli/blob/5df9451723c7fe81462700c19709c0b06846de95/src/resources/rmd/hooks.R#L631-L634

cderv
2023-06-08T12:56:30Z
cderv
bug knitr
v1.4
open
Correctly replace knitr options which had their name normalized from - to .
https://github.com/quarto-dev/quarto-cli/issues/5852