0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

update condition

This commit is contained in:
apatel369 2024-11-30 14:53:48 -06:00
parent 14ba50f5f2
commit 18449c818d

View file

@ -30,7 +30,13 @@ export const rehypeAnalyzeAstroMetadata: RehypePlugin = () => {
if (node.type !== 'mdxJsxFlowElement' && node.type !== 'mdxJsxTextElement') return;
const tagName = node.name;
if (!tagName || !isComponent(tagName)) return;
if (
!tagName ||
!isComponent(tagName) ||
!hasClientDirective(node) ||
!hasServerDeferDirective(node)
)
return;
// From this point onwards, `node` is confirmed to be an island component