Conditional content div ignores additional attributes (id, extra classes) on same div

Open
#14,289 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript
Domain
cli, content

Research direction

Start with the minimal Quarto Markdown example in the issue and render it to HTML using the reported Quarto version. Trace conditional-content div handling and compare the generated section attributes with the expected class; done means the additional class and other attributes are preserved while the condition still works.

Written by the indexing model from the issue text.

Description

bug lint
I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

When a fenced div uses a conditional content class such as .content-visible or .content-hidden, other attributes on that same div appear to be dropped or ignored in output. For example, custom IDs and additional classes are not preserved as expected.

Steps to reproduce

Create a div with some attribute (e.g., a class) and a .content-visible class with some condition:

:::{.slide-in-handout .content-visible when-meta="make.slide"}
## Div text

Day handsome addition horrible sensible goodness two contempt. Evening for married his account removal. Estimable me disposing of be moonlight cordially curiosity. Delay rapid joy share allow age manor six. Went why far saw many knew. Exquisite excellent son gentleman acuteness her. Do is voice total power mr ye might round still.
:::
Actual behavior

In the rendered HTML, the div tag (which is actually turned into a <section>) does not contain the .slide-in-handout class.

<section>
Expected behavior

Since conditional content is technically a div, using Pandoc's div syntax, I would have expected that other attributes are preserved in the HTML output.

<section class="slide-in-handout">
Your environment

VSCode on Windows 11

Quarto check output
Quarto 1.9.36
[>] Checking environment information...
      Quarto cache location: C:\Users\cberger\AppData\Local\quarto
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.8.3: OK
      Dart Sass version 1.87.0: OK
      Deno version 2.4.5: OK
      Typst version 0.14.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.9.36
      Path: C:\Program Files\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)
      Chrome Headless Shell: (not installed)
      VeraPDF: (not installed)

[>] Checking LaTeX....................OK
      Tex:  (not detected)

[>] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
      Source: Windows Registry

[>] Checking basic markdown render....OK

[>] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

[>] Checking Python 3 installation....(None)

      Unable to locate an installed version of Python 3.
      Install Python 3 from https://www.python.org/downloads/

[>] Checking Julia installation...
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.