diff --git a/__fixtures__/toml-with-content/expected.jsx b/__fixtures__/toml-with-content/expected.jsx new file mode 100644 index 0000000..7aca5d8 --- /dev/null +++ b/__fixtures__/toml-with-content/expected.jsx @@ -0,0 +1,11 @@ +/*@jsxRuntime automatic @jsxImportSource react*/ +export const title = "Hello TOML"; +function MDXContent(props = {}) { + const _components = Object.assign({ + h1: "h1", + p: "p" + }, props.components), {wrapper: MDXLayout} = _components; + const _content = <><_components.h1>{"Hello, World"}{"\n"}<_components.p>{"Some content"}; + return MDXLayout ? {_content} : _content; +} +export default MDXContent; diff --git a/__fixtures__/toml-with-content/input.md b/__fixtures__/toml-with-content/input.md new file mode 100644 index 0000000..d10d31d --- /dev/null +++ b/__fixtures__/toml-with-content/input.md @@ -0,0 +1,7 @@ ++++ +title = "Hello TOML" ++++ + +# Hello, World + +Some content diff --git a/__fixtures__/toml-with-content/options.json b/__fixtures__/toml-with-content/options.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/__fixtures__/toml-with-content/options.json @@ -0,0 +1 @@ +{} diff --git a/src/index.ts b/src/index.ts index bae83a9..f4042a2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,7 +44,7 @@ export const remarkMdxFrontmatter: Attacher<[RemarkMdxFrontmatterOptions?]> = data = parse(value); } if (data == null) { - return; + continue; } if (!name && typeof data !== 'object') { throw new Error(`Expected frontmatter data to be an object, got:\n${value}`);