Skip to content

Commit

Permalink
Merge pull request #4 from yordis/fix-node-lookup
Browse files Browse the repository at this point in the history
fix: node type lookup
  • Loading branch information
remcohaszing committed Nov 15, 2021
2 parents eb7ee1d + e16b693 commit 66cbbec
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions __fixtures__/toml-with-content/expected.jsx
Original file line number Diff line number Diff line change
@@ -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"}</_components.h1>{"\n"}<_components.p>{"Some content"}</_components.p></>;
return MDXLayout ? <MDXLayout {...props}>{_content}</MDXLayout> : _content;
}
export default MDXContent;
7 changes: 7 additions & 0 deletions __fixtures__/toml-with-content/input.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+++
title = "Hello TOML"
+++

# Hello, World

Some content
1 change: 1 addition & 0 deletions __fixtures__/toml-with-content/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit 66cbbec

Please sign in to comment.