Skip to content

Conditional Block used with format: jats errors #13629

Open

Description

@cderv
---
title: "Conditional Block in manuscript JATS"
format: jats
---

::: {.content-visible when-format="jats"}

Something

:::

Content

Found while looking deeper in

Opening a new issue as it could be different from #13616 (comment)

Activity

  1. self-assigned this
    on Oct 30, 2025
  2. cderv commented on Oct 30, 2025

    @cderv
    MemberAuthor

    I think this is an issue as we use jog traversal which will mutate element, and we do unroll div

    function jats()
    if _quarto.format.isJatsOutput() then
    return {
    Meta = jatsMeta,
    -- clear out divs
    Div = function(div)
    if isTableDiv(div) then
    local tbl = div.content[1]
    if tbl.t == "Table" then
    tbl.identifier = div.identifier
    end
    return tbl
    else
    -- otherwise, if this is a div, we can unroll its contents
    -- TODO can we replace this by a single return div.content?
    return unrollDiv(div, is_custom_node)
    end
    end,

    So I think this is modifying the node.node element of the ConditionalBlock custom node:

    render = function(node)
    local visible = is_visible(node)
    if visible then
    local el = node.node
    clearHiddenVisibleAttributes(el)
    return el.content
    else
    return {}
    end
    end,

    and this make the custom ast render fail.

    So I need to find the right way. This is a bit different than pandoc.List() , pandoc.Blocks({}) change.

  3. added this to the Future milestone on Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingjats

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions