Skip to main content

Empty Tag Component

yaml
A YAML tag has an empty component, usually caused by leading, trailing, or consecutive underscores.

Q-1-24 — Empty Tag Component

A YAML tag has an empty component, usually caused by leading, trailing, or consecutive underscores.

What this means

Quarto’s configuration tags use the underscore as a separator between components: !prefer_md, !concat_path. Each underscore-separated piece must be a non-empty name. This error fires when the split produces an empty piece, which happens when underscores are doubled, lead, or trail.

Why this happens

Three shapes trigger this error:

  • Leading underscore: !_md, which splits into an empty component followed by md.
  • Trailing underscore: !prefer_, which splits into prefer followed by an empty component.
  • Consecutive underscores: !prefer__md, which splits with an empty component between prefer and md.

How to fix

Remove the offending underscores. The corrected forms of the examples above are !md, !prefer, and !prefer_md respectively.

If you intended an underscore to be part of the value rather than the tag, the value is on the next line and the tag should not contain it. Underscores inside the YAML value itself pass through normally.