Closed sumanthratna closed 5 months ago
Hey!
That is indeed not something that works. It is intentional. MDX is not a template language.
# <a href={metadata.path}>{metadata.title}</a>
Thanks for clarifying @wooorm! I am still a little confused about the mechanics of interpolation.
The following does not interpolate the title:
# `{metadata.title}`
The following does:
# ~**_{metadata.title}_**~
Is there a rule to understand which Markdown features result in interpolation?
Code will never interpolate. Inlines (strong, emphasis, strike) usually will.
Initial checklist
Affected packages and versions
3.0.1
Link to runnable example
Steps to reproduce
This is my MDX file:
Expected behavior
The above MDX should render the following HTML after interpolating
metadata.path
:Actual behavior
The above MDX renders the following HTML:
Note that the link text is interpolated properly, but not the link href.
Runtime
Node v21
Package manager
yarn v4
OS
macOS
Build and bundle tools
Next.js