Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Author name doesn't render correctly with YAML listing content when using extended author schema #12052

Open
irmoodie opened this issue Feb 10, 2025 · 1 comment
Labels
bug Something isn't working listings

Comments

@irmoodie
Copy link

Bug description

When using a YAML listing content file, the first two examples render correctly, but the third does not.

Renders correctly:

- title: "Item 1"
  author: Bob Smith

Renders correctly:

- title: "Item 1"
  author: 
    - Bob Smith
    - Anna Smith

Renders author names as [object Object]:

- title: "Item 1"
  author: 
    - name:
        family: Smith
        given: Anna
    - name:
        family: Smith
        given: Bob

The bug is identical to closed issue: #4881 (comment)

Steps to reproduce

listing.qmd:

---
title: "Listing Example"
listing:
  id: sample-listings
  contents: listing.yaml
  sort: "date desc"
  type: table
---

listing.yaml:

- title: "Item 1"
  author: 
    - name:
        family: Smith
        given: Anna
    - name:
        family: Smith
        given: Bob

Expected behavior

The author list processed and names appear as documented in the Quarto docs.

Actual behavior

The reprex is rendered with author names as [object Object]:

Image

Your environment

OS: macOS 15.2 24C101 arm64
IDE: VSCode 1.96.3

Quarto check output

quarto check
Quarto 1.6.40
[✓] Checking environment information...
      Quarto cache location: /Users/iain/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.6.40
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /Library/TeX/texbin
      Version: 2022

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

[✓] Checking Python 3 installation....OK
      Version: 3.10.12 (Conda)
      Path: /opt/homebrew/Caskroom/miniforge/base/bin/python
      Jupyter: 5.7.2
      Kernels: julia-1.8, python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.4.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
      knitr: 1.48
      rmarkdown: 2.28

[✓] Checking Knitr engine render......OK
@irmoodie irmoodie added the bug Something isn't working label Feb 10, 2025
@mcanouil
Copy link
Collaborator

mcanouil commented Feb 10, 2025

This is not the same issue as the previous one but related at least.
Thanks for the report.

It seems to be an issue when providing the YAML directly to contents

A screenshot showing a code editor and a web browser preview. In the code editor, a Quarto blog post is written in YAML and Markdown. The post is titled "Welcome To My Blog" and authored by Anna Smith and Bob Smith, dated February 7, 2025, under the category "news." The Markdown includes a placeholder for an image and a note about image usage. The web browser preview displays a blog listing with two posts: "Post With Code" by Harlow Malloc dated February 10, 2025, and "Welcome To My Blog" by Anna Smith and Bob Smith dated February 7, 2025.

If you use the complete author schema, directly without putting in in a YAML file, you can already see the issue.

---
title: "12052"
listing:
  contents:
    - title: "Archived Item 1"
      author: Norah Jones
      date: 2020-01-01
      path: "archived/archived-item-.html"
      categories: [archived, technology]
    - title: "Archived Item 1"
      author: 
        - name:
            family: Smith
            given: Anna
        - name:
            family: Smith
            given: Bob
      date: 2020-01-01
      path: "archived/archived-item-.html"
      categories: [archived, technology]
  sort: "date desc"
  type: table
  categories: true
  sort-ui: false
  filter-ui: false
page-layout: full
title-block-banner: true
---
Array entry 1 with value name:
  family: Smith
  given: Anna failed to be a string.
Array entry 2 with value name:
  family: Smith
  given: Bob failed to be a string.

Listings from YAML does not expect name to be an array in this context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working listings
Projects
None yet
Development

No branches or pull requests

2 participants