quarto-dev / quarto-dev/quarto-cli

Move "markdown envelope" earlier in Quarto toolchain

Open
#13,012 0 comments 1 reaction 1 assignee View on GitHub

@cscheid is already working on this.

Since Jul 1, 2025.

enhancement
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Quarto has a mechanism for rendering snippets text into markdown through the entire filter chain (so that eg. crossrefs are resolved properly). Internally, we call it the "markdown envelope". It interacts badly with some of the ordering in Quarto's rendering process, so we need to fix it.

Original comment

Even in block position, it's still rendering as {{< include _footer.qmd >}} instead of © 2025 My Website..

Ok, that makes sense and yes, it is a block! So let me give a full explanation:

As a very short answer, it's a shortcoming of Quarto that the include shortcode doesn't work on markdown values in _quarto.yml the same way that {{< version >}} does.

Notice that I'm not calling it a bug. That's because it's a design shortcoming. The shortcoming comes when when these two following facts interact:

  • include needs to make document inclusions available at the time of engine execution, and so include needs to do its thing very
  • Markdown content in YAML is almost entirely handled by Pandoc (for example for title fields, etc). However, we do have the concept of a Markdown envelope, which is built by Quarto ahead of Pandoc (such as websites), but that handling happens relatively late in our pipeline. Crucially, that's after engine execution, and hence after include has already been resolved.

One solution is to move Quarto's handling of Markdown-in-YAML ahead of include execution.

This is a relatively large change in Quarto: it affects engine detection. It changes what Markdown is available during the resolution of include shortcodes. If we were to make such a change, engine detection now would see the markdown envelope.

I actually like this; we need to make the Markdown envelope more explicit and document it. But it needs to be done carefully.

Originally posted by @cscheid in https://github.com/quarto-dev/quarto-cli/discussions/13001#discussioncomment-13619658

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.