### Bug description

In a new project, this is the reprex document
````
---
title: "Untitled"
format: 
  html:
    self-contained: false
---

## Title

```{r}
mtcars |> 
  kableExtra::kbl()
```
````

This will error with latest **htmltools** 0.5.3 version: 
````
#> Error in `normalizePath()`:
#> ! path[1]="test_files\libs/kePrint-0.0.1": Le chemin d’accès spécifié est introuvable
#> Backtrace:
#>     ▆
#>  1. └─global .main()
#>  2.   └─execute(...)
#>  3.     └─pandoc_includes(...)
#>  4.       └─dependencies_from_render(input, files_dir, knit_meta, format)
#>  5.         └─html_dependencies_as_string(extras$dependencies, files_dir)
#>  6.           └─base::lapply(dependencies, htmltools::copyDependencyToDir, files_dir)
#>  7.             └─htmltools (local) FUN(X[[i]], ...)
#>  8.               └─base::normalizePath(target_dir, "/", TRUE)
#> Warning messages:
#> 1: In dir.create(outputDir) :
#>   cannot create dir 'test_files\libs', reason 'No such file or directory'
#> 2: In dir.create(target_dir) :
#>   cannot create dir 'test_files\libs\kePrint-0.0.1', reason 'No such file or directory'
#> Execution halted
````

Note that with 0.5.2 version, the warning are still there 
```
#> Warning messages:
#> 1: In dir.create(outputDir) :
#>   cannot create dir 'test_files\libs', reason 'No such file or directory'
#> 2: In dir.create(target_dir) :
#>   cannot create dir 'test_files\libs\kePrint-0.0.1', reason 'No such file or directory'
```

This is because the directory passed to `copyDependencyToDir` for `test.qmd` is `test_files/libs` which is not really supported in **htmtools** I believe. I opened an issue there to discuss: https://github.com/rstudio/htmltools/issues/331

Quick fix in quarto would be to create `test_files/` folder ourself, but v1 is already out, so this can wait and we could see in **htmltools** can support it IMO. 

2022-07-22T13:37:57Z
cderv
bug
Future
closed
Quarto with R does not correctly use htmltools for dependency creation
https://github.com/quarto-dev/quarto-cli/issues/1497