e.g.

````markdown
```{python}
#| output: asis
%%javascript

// some JS code
```
````

This is because cell magics need to be the first line of the cell. 

Note that the `keep-ipynb` feature is really designed for debugging rather than for producing a final notebook for distribution (e.g. markdown constructs like citations and crossrefs are not resolved in this version). We should either resolve this or make it more clear in the documentation that `keep-ipynb` is for debugging intermediate representations (we could even change the filename to make this more clear).

jjallaire
2022-08-25T12:25:17Z
jjallaire
enhancement
v1.4
open
keep-ipynb notebook with cell magics and yaml options can't be executed
https://github.com/quarto-dev/quarto-cli/issues/2123