Unsupported markdown inside an lmd fragment
Q-26-2 — Unsupported markdown inside an lmd fragment
A markdown fragment in an lmd cell contains a node the fragment emitter has no constructor for, such as a shortcode. The cell is left as written and does not run.
What this means
A markdown fragment inside an lmd cell is parsed as markdown and rewritten
into pandoc.* constructor calls. The fragment contained a kind of node
that this rewriting does not support yet, so the cell was not run and stays
in the document as a plain code block. The warning names the node kind
and underlines the offending markdown inside the fragment.
Why this happens
The fragment contains one of:
- a shortcode (
{{< meta key >}}and friends); - CriticMarkup insertions, deletions or comments;
- a custom node produced by an extension.
A footnote is not one of these. A note defined inside the fragment
([^1] with its [^1]: … definition) is paired with the fragment’s
references when the cell is desugared, and a reference whose definition
is in the document body is resolved with the document’s other notes.
How to fix
Move the unsupported markdown out of the fragment, or build that part
with constructors instead. For a value from metadata, read it in Lua
rather than through a shortcode: meta.key or
quarto.metadata.get("key") inside the fragment as `{lmd} meta.key`.
```{lmd}
return {=: Version {{< meta version >}} here. :=}
```
becomes
```{lmd}
return {=: Version `{lmd} meta.version` here. :=}
```