Skip to content
Discussion options

You must be logged in to vote

It is not supported by default. It's not a Docusaurus limitation, but an MDX limitation, that I believe it here on purpose and make sense.

When using Markdown syntax like code blocks, JS expressions like ${props.filename} are not evaluated, only JSX elements allow you to use JS expressions. Markdown syntax is not for code, it's for content. And here, what you do is code, so you'd rather use JSX instead (MDX partial, or even a real React component)

If you want expressions like this to be evaluated, you would need to write a Remark plugin for MDX to add this behavior yourself. You may find this issue interesting: #395

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@FoxxMD
Comment options

Answer selected by FoxxMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants