Releases: mdx-js/mdx
v0.16.2
v0.16.1
v0.16.0
- add all missing dependencies to MDX packages, now they should work with Yarn Plug'n'Play
- get rid of React warning about
metaString
prop by renaming it to lowercasemetastring
instead - remove a lot of unnecessary dependencies for modern React environments in @mdx-js/tag
⚠️ this is a breaking change for React < 16.3
v0.15.7
v0.15.6
-
add support for remark and rehype plugins to @mdx-js/runtime
<MDX components={components} mdPlugins={[slug, autolinkHeadings]} hastPlugins={[[addClasses, { h1: 'title' }]]} children="# Hello world!" />
-
Formidable released spectacle-boilerplate-mdx!
-
fix bug where a semicolon would break an
export default
statement (#277)
v0.15.5
v0.15.4
Fix edge case with multiline default exports
The following export statement used to cause a syntax error if it was at the end of the MDX file:
export default ({ children }) => (
<Layout>
{children}
</Layout>
)
This has now been fixed. (#188)
Better error upon encountering a named default export
The following exporting default
via named exports used to cause an error that there are duplicate default exports (#205):
export { default } from './Layout'
Now it throws a better error, suggesting to use the default export statement instead:
import Layout from './Layout'
export default Layout
v0.15.3
Fix translating style
, aria-*
and data-*
properties to JSX
Some plugins like rehype-katex add style
and aria-*
properties. These properties need to be handled differently in JSX, so now we convert all style
properties from string to object syntax, and all aria-*
and data-*
property names from camelCase to param-case. (#261)
Info string
Both CommonMark and GFM support adding additional text after language definition in fenced code blocks, a.k.a. the info string. Now MDX passes this data as props:
```js repl
console.log('Hello world!')
```
The above compiles roughly to:
<MDXTag name="pre" components={components}>
<MDXTag
name="code"
components={components}
parentName="pre"
props={{
className: 'language-js',
metaString: 'repl',
repl: true,
}}
>
{`console.log('Hello world!');`}
</MDXTag>
</MDXTag>
One use case for this is adding props for Prism's line-highlight plugin:
```js data-line=2
function doSomething() {
throw new Error('Something went wrong') // this line will be highlighted!
}
```
More stable support for comments
Our support for comments was a spotty (#244, #256), but now we're taking advantage of remark's ability to recognize comments, which should take care of all edge cases.
Nested comments
We used to support Markdown-like comments nested in JSX:
## Heading
<MyComp>
<!-- this is a comment?! -->
</MyComp>
This was odd and misleading because the rest of the comment wasn't being interpreted as MDX. We removed this feature, so if you were relying on this behavior, simply use JSX comments instead:
## Heading
<MyComp>
{/* now that's a comment! */}
</MyComp>
Add filepath info to the loader
v0.15.2 v0.15.2
Whitespace is now properly preserved in code blocks
v0.15.1 v0.15.1