Skip to content
Discussion options

You must be logged in to vote

One reason I can think of this isn’t supported, is because MDX doesn’t know your intent is to interpolate. For example what if your intention is to show how your HTML templating library could interpolate data?

Another reason is code blocks may contain any kind of language. We’ve all seen HTML templating languages before, but what about this example?

```js
if (condition) { sayHello() }
```

Should it render as this?

<pre><code class="language-js">if (condition) { sayHello() }</code></pre>

or as this?

<pre><code class="language-js">if (condition) {hello}</code></pre>

I do see how your use case is useful though. I suggest using remark-mdx-code-meta and a custom component.

// Use any templatin…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by wooorm
Comment options

You must be logged in to vote
0 replies
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