Skip to content

Listings: custom listings without fields: keep derivable description/image - #817

Merged
cscheid merged 2 commits into
mainfrom
bugfix/bd-listing-description-precedence-x4bh6w3m-custom-derived-fields
Oct 10, 2026
Merged

cscheid merged 2 commits into
mainfrom
bugfix/bd-listing-description-precedence-x4bh6w3m-custom-derived-fields

Conversation

@cscheid

@cscheid cscheid commented Oct 10, 2026

Copy link
Copy Markdown
Member

Follow-up to #814 and #815 (bd-listing-description-precedence-x4bh6w3m).

#815 gave a type: custom listing without fields: every field that some item carries (fields_items_carry). That check left out a description or image that only the L7 post-render pass can derive from the rendered page. In that case show.description was false, the built-in item-default partial dropped the envelope, and the item showed no description. This happens when a page's first paragraph exists only after rendering: engine output, raw HTML, or a paragraph inside a div.

fields_items_carry now counts those fields the same way effective_fields already does for the built-in layouts. This matches Q1, where every document item carries both placeholders.

  • binding.rs: in fields_items_carry, description and image also count when derivable(it, source).
  • Tests:
    • New unit test custom_listing_without_fields_keeps_derivable_fields.
    • The integration test listing_derives_description_present_only_in_rendered_output now also covers a custom listing.
    • Both fail without the fix.
  • Repro: repro/custom.qmd lists derived-only/e.qmd, whose only paragraph is inside a div. Before the fix its description is missing; after the fix it shows.
  • Docs: one sentence in the Fields section of listings.qmd.

cargo xtask verify --skip-hub-build passes locally.

🤖 Generated with Claude Code

…ields: keep derivable description/image

#815's fields_items_carry gated custom listings without fields: on
fields some item already carries, which missed a description or image
only L7 can derive. Count those the way effective_fields does, so
$items:item-default()$ still emits their envelopes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@posit-snyk-bot

posit-snyk-bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

…ription-precedence-x4bh6w3m-custom-derived-fields

# Conflicts:
#	crates/quarto-core/src/project/listing/binding.rs
@cscheid
cscheid merged commit cbb0886 into main Oct 10, 2026
11 checks passed
@cscheid
cscheid deleted the bugfix/bd-listing-description-precedence-x4bh6w3m-custom-derived-fields branch October 10, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants