chore: use error hint
This commit is contained in:
parent
c876d3fee3
commit
76cc6a1212
1 changed files with 4 additions and 6 deletions
|
@ -32,7 +32,6 @@ export function createAstroNode(
|
||||||
if (isCapitalized(node.name) && node.name in components) {
|
if (isCapitalized(node.name) && node.name in components) {
|
||||||
const component = components[node.name];
|
const component = components[node.name];
|
||||||
const props = node.attributes;
|
const props = node.attributes;
|
||||||
|
|
||||||
const children = node.children.map((child) => createAstroNode(child, components));
|
const children = node.children.map((child) => createAstroNode(child, components));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -41,11 +40,10 @@ export function createAstroNode(
|
||||||
children,
|
children,
|
||||||
};
|
};
|
||||||
} else if (isCapitalized(node.name)) {
|
} else if (isCapitalized(node.name)) {
|
||||||
throw new Error(
|
throw new MarkdocError({
|
||||||
`[Markdoc] Unable to render ${JSON.stringify(
|
message: `Unable to render ${JSON.stringify(node.name)}.`,
|
||||||
node.name
|
hint: 'Did you add this to the "components" prop on your <Content /> component?',
|
||||||
)}. Did you add this to the "components" prop on your <Content /> component?`
|
});
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
tag: node.name,
|
tag: node.name,
|
||||||
|
|
Loading…
Reference in a new issue