### Bug description

We have a Quarto book where we document how to write blog posts on our Hugo website. With the pre-release version of Quarto (and the released version, but not with `1.3.49` that I have locally) the build fails because of the chunk below:

````
```{shortcodes=false}

{{< gallery >}}
{{< figureforgallery src="search2.png" alt="Screenshot of r-universe simple search results." >}}
{{< figureforgallery src="search3.png" alt="Screenshot of r-universe advanced search query." >}}
{{< figureforgallery src="search4.png" alt="Screenshot of r-universe advanced search results." >}}
{{< /gallery >}}
```
````

The error is `ERROR: invalid shortcode: /gallery`.


### Steps to reproduce

I've set up a reprex at https://github.com/maelle/quartohugo It's the default Quarto book created with RStudio IDE (Create New Project > Quarto book) except I tweaked https://github.com/maelle/quartohugo/blob/main/index.qmd to include the faulty chunk.

I added a GHA workflow https://github.com/maelle/quartohugo/blob/main/.github/workflows/render.yaml The latest log is at https://github.com/maelle/quartohugo/actions/runs/5253624754/jobs/9491184540

### Expected behavior

The book should be built and the shortcode should appear as is in code.

### Actual behavior

There is an error `ERROR: invalid shortcode: /gallery`.

### Your environment

ubuntu-latest on GHA

### Quarto check output

I'm using the official Quarto GitHub Action so hopefully it's fine I don't answer this!
cscheid
2023-06-13T09:16:13Z
maelle
bug triaged-to
v1.4
closed
Trouble escaping a Hugo paired shortcode
https://github.com/quarto-dev/quarto-cli/issues/5902