You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My analysis is that the sequence of conversion inside Markdown is incorrect.
if the variable substition is done at the end (after the entire page is converted to a Vue page), it will not be recognised by Anchor.
on the other hand, if the variable substitution is done early, it will allow the correct text replacement to appear inside the Markdown text, and be recognised by Anchor.
In Vitepress there is also a similar feature of embedding frontmatter variables inside content, and it uses the early binding strategy. Embedded Vue components are processed at the end. This work flow creates the correct conversion of Markdown with embedded variables and components without breaking any Markdown syntax.
Hello @kaceo
Nuxt Content bind variables at render time, That's why the second line did not convert to anchor link (because it is not a valid link format). Variable binding in Content module is designed to render dynamic data and not replacing static text in parse time.
Early binding can be implemented using Content transformers by replacing bindings before parsing the markdown.
Environment
Reproduction
See below
Describe the bug
In a markdown file, if an anchor link contains a variable substition, it does not become a link
e.g.
After nuxt runs, line 1 creates a line of text correctly substituted.
Line 2 creates the substitution correctly but Markdown does not change it into an anchor:
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: