### Bug description

The scenario is the following: 
- a blog is set up with quarto template 
- there is a post in a directory starting with letter "u", let's say the directory is called `posts\useful_stuff`
- the blog post is a `.qmd` file 
- in a blog post, there is an `ojs` cell (doesn't matter what is inside)
- blog is rendered using `quarto render` 
- blog is published to github pages using `quarto publish gh-pages` 
- on a published blog on the server, when the blog post is opened, the `ojs` cells do not render any ObservableJS content, and in the console there is an Error "Uncaught SyntaxError: Invalid Unicode escape sequence" 
- following the error points to the line `window._ojs.paths.runtimeToDoc = "..\..\posts\useful_stuff";` which is producing the error 
- according to [this post](https://stackoverflow.com/questions/12450633/expected-hexadecimal-digit), once JS encounters a sequence "\u" in the string, it expects a unicode character, so it misreads the directory name `\useful_stuff` as a unicode string 
- manually editing rendered html so that the line reads `window._ojs.paths.runtimeToDoc = "../../posts/useful_stuff";`  fixes the error and the blog post gets rendered correctly 

The same happens when deploying locally with the live server instead of github pages. 

Please fix this bug as it will be very annoying to avoid starting the the subdirectory name with the letter "u" :) 

### `quarto check` Output

_No response_

### `quarto tools check` Output

_No response_

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [ ] included 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.
- [ ] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [ ] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [ ] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [ ] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [ ] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
cscheid
2022-07-31T00:01:04Z
paniterka
bug ojs-engine
closed
When publishing ojs blog posts, quarto renders the ojs runtime path with backslashes, so when a post directory starts with "u", OJS blocks produce Uncaught SyntaxError and the content does not render
https://github.com/quarto-dev/quarto-cli/issues/1605