When creating a figure div with [subfigures](https://quarto.org/docs/authoring/figures.html#subfigures), the `id` attribute of the *main* figure div is lost in HTML output **as soon as `layout-ncol` is specified**, resulting in broken hyperlinks.

Consider the following reproducible example:

- Source file: [`t.qmd`](https://salim-b.gitlab.io/adhoc/t.qmd)
- Render command: `quarto render t.qmd --to=html --metadata=keep-md:true`
- Intermediate Markdown file: [`t.md`](https://salim-b.gitlab.io/adhoc/t.md)
- Final HTML file: [`t.html`](https://salim-b.gitlab.io/adhoc/t.html)

PDF/LaTeX output is not affected by this bug (i.e. all figure cross-reference links work fine).

Using latest Quato release from GitHub, v0.9.514.

<!--
Welcome to the quarto GitHub repo!

We are always happy to hear feedback from our users.

To file a _bug report_, please follow these instructions carefully: <https://yihui.org/issue/#bug-reports>

Also, please complete and keep the checklist below in your issue. This helps you know what to check for opening a good issue report. It also helps know that you've have done the common steps that can solve your potential issue.

At last, if you have posted the same issue elsewhere, please mention it here, with a link to the other issue.

-->

## Checklist

When filing a _bug report_, please check the boxes below to confirm that you have provided us with the information we need. Have you:

- [x] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?

- [x] included a minimal, self-contained, and reproducible example?

- [x] documented the quarto version you're running, by providing the output produced by `quarto check` in a terminal in your issue?

- [x] upgraded to the latest version (including your versions of R, the RStudio IDE, and relevant R packages)?

2022-06-04T15:13:45Z
salim-b
closed
Specifying `layout-ncol` breaks main figure div cross-reference link in HTML output
https://github.com/quarto-dev/quarto-cli/issues/1060