fix: filter out MDX parsing artifacts from product descriptions
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / ⚡ Performance & Accessibility (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Has been cancelled
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / ⚡ Performance & Accessibility (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Has been cancelled
This commit is contained in:
@@ -273,7 +273,14 @@ export default async function ProductPage({ params }: ProductPageProps) {
|
|||||||
(node: any) => node.type === 'block' && node.fields?.blockType === 'productTabs',
|
(node: any) => node.type === 'block' && node.fields?.blockType === 'productTabs',
|
||||||
);
|
);
|
||||||
if (tabsBlock?.fields?.content?.root?.children) {
|
if (tabsBlock?.fields?.content?.root?.children) {
|
||||||
descriptionChildren = tabsBlock.fields.content.root.children;
|
descriptionChildren = tabsBlock.fields.content.root.children.filter((node: any) => {
|
||||||
|
// Filter out MDX parsing artifacts like `}>`
|
||||||
|
if (node.type === 'paragraph' && node.children?.length === 1) {
|
||||||
|
const text = node.children[0]?.text?.trim();
|
||||||
|
return text !== '}>' && text !== '{' && text !== '}';
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user