Skip to content

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

@cboct

Description

@cboct

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglintlinting-related issues

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions