### Bug description

I have the below code in a Quarto project and I'm trying to render to pdf. 
````{r}
#| label: fig-ash-map
#| fig-cap: "Map of Town of Ashland"

ashland <- st_read('https://services2.arcgis.com/sKZWgJlU6SekCzQV/arcgis/rest/services/Ashland_Boundary/FeatureServer/0/query?outFields=*&where=1%3D1&f=geojson', quiet = TRUE)

leaflet(ashland) %>% 
  addTiles() %>% 
  addPolygons()

````

I get the following error that was not occurring previously:

> Error: Functions that produce HTML output found in document targeting pdf output.Please change
> the output type of this document to HTML. Alternatively, you can allow
> HTML output in non-HTML formats by adding this option to the YAML front-matter ofyour quarto file:
> 
>   prefer-html: true
> 
> Note however that the HTML output will not be visible in non-HTML formats.

I've updated quarto cli to the 1.2.269 Candidate Release on Windows 11 Pro. It worked fine on my other machine and all packages are updated. My yml includes the following settings for pdf export:

> knitr:
>   opts_chunk: 
>     echo: false
>     warning: false
>     message: false
> 
> format:
>   html:
>     theme: lumen
>   pdf:
>     documentclass: scrreprt


Please help! I was having no issue with Quarto exporting these out to a pdf previously but am now all of a sudden.

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
cderv
2022-11-10T20:44:03Z
ericvmai
bug enhancement
v1.4
open
error with pdf output and html function (leaflet)
https://github.com/quarto-dev/quarto-cli/issues/3279