-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to render \${...} in code block #902
Comments
It is escaping
results in /* @jsx mdx */
const makeShortcode = name => function MDXDefaultShortcode(props) {
console.warn("Component " + name + " was not imported, exported, or provided by MDXProvider as global scope")
return <div {...props}/>
};
const layoutProps = {
};
const MDXLayout = "wrapper"
function MDXContent({
components,
...props
}) {
return <MDXLayout {...layoutProps} {...props} components={components} mdxType="MDXLayout">
<pre><code parentName="pre" {...{}}>{`python command subdir=\\${model.nb_layers}
`}</code></pre>
</MDXLayout>;
}
;
MDXContent.isMDXComponent = true; while
results in /* @jsx mdx */
const makeShortcode = name => function MDXDefaultShortcode(props) {
console.warn("Component " + name + " was not imported, exported, or provided by MDXProvider as global scope")
return <div {...props}/>
};
const layoutProps = {
};
const MDXLayout = "wrapper"
function MDXContent({
components,
...props
}) {
return <MDXLayout {...layoutProps} {...props} components={components} mdxType="MDXLayout">
<pre><code parentName="pre" {...{}}>{`python command subdir=\${model.nb_layers}
`}</code></pre>
</MDXLayout>;
}
;
MDXContent.isMDXComponent = true; The question is, should it? |
@ChristianMurphy to be clear, I want to render the |
@ChristianMurphy, the desired output to show to the user |
I placed a $100 bounty for the person whose pull request for fixing this issue gets merged. Add to or claim the bounty here https://www.bountysource.com/issues/86803859-unable-to-render-in-code-block. |
I created PR #991 for fix this. Take a look please. |
@lex111 awesome and nice to see that you are going after it. As far as the PR goes I cannot judge it so we/you are at the mercy of the mdx crew. I have subscribed to the PR so I will keep an eye on it 🤞 |
Subject of the issue
Feel free to close if this is not a bug (or bug of some other library).
I'm trying to render the following
but it crashes because MDX tries to evaluate the contents of the
${...}
. I suspect some double escaping occurs and the problem (if indeed a problem) lies in this line. Or it could be a remark issue. Not entirely sure which.I also posted on Spectrum here because I wasn't sure whether this was a bug.
Your environment
@mdx-js/mdx@1.15.1
Steps to reproduce
Repo here - https://github.com/yangshun/hydra/blame/master/website/docs/configure_hydra/workdir.md#L67-L69
Expected behaviour
Renders fine. It renders ok for GFM.
Actual behaviour
MDX tries to evaluate the contents of the
${...}
. I suspect some double escaping occurs.The text was updated successfully, but these errors were encountered: