1
1
mirror of https://github.com/jxnblk/mdx-deck.git synced 2024-11-29 13:58:02 +03:00

Update mdx options and snapshots

This commit is contained in:
Brent Jackson 2019-04-05 13:12:33 -04:00
parent 12bd1337ff
commit d31d355cc2
4 changed files with 14 additions and 15 deletions

View File

@ -5,8 +5,8 @@ const mdxPlugin = require('@mdx-deck/mdx-plugin')
module.exports = async function(src) {
const callback = this.async()
const options = getOptions(this) || {}
options.mdPlugins = options.mdPlugins || []
options.mdPlugins.push(mdxPlugin)
options.remarkPlugins = options.mdPlugins || []
options.remarkPlugins.push(mdxPlugin)
const result = mdx.sync(src, options)

View File

@ -38,7 +38,7 @@ const rules = [
{
loader: require.resolve('@mdx-deck/loader'),
options: {
mdPlugins: [remark.emoji, remark.unwrapImages],
remarkPlugins: [remark.emoji, remark.unwrapImages],
},
},
],

View File

@ -41,19 +41,18 @@ const MDXLayout = props =>
</section>
export default function MDXContent({ components, ...props }) {
return (
<div
name=\\"wrapper\\"
<MDXLayout
{...layoutProps}
{...props}
components={components}>
<MDXLayout {...layoutProps} {...props}>
<h1 >{\`Hello\`}</h1>
<hr ></hr>
<h2 >{\`Two\`}</h2>
<hr ></hr>
<h2 >{\`Three\`}</h2>
</MDXLayout>
</div>
<h1>{\`Hello\`}</h1>
<hr></hr>
<h2>{\`Two\`}</h2>
<hr></hr>
<h2>{\`Three\`}</h2>
</MDXLayout>
)
}
MDXContent.isMDXComponent = true"

View File

@ -16,7 +16,7 @@ export default props =>
test('adds an export', () => {
const code = mdx.sync(src, {
mdPlugins: [plugin],
remarkPlugins: [plugin],
})
expect(typeof code).toBe('string')
expect(code).toMatchSnapshot()