fix(mdx): handle double curly braces serialization in MDX payload attributes
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Successful in 48s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has been cancelled

This commit is contained in:
2026-05-07 12:07:45 +02:00
parent ac437e19f3
commit 85797ccf73
3 changed files with 19 additions and 3 deletions

View File

@@ -40,9 +40,19 @@ function HeroSection(props: any) {
}
async function Block(props: any) {
const { type, data, children } = props;
const { type, children } = props;
let { data } = props;
const locale = await getLocale();
// If data was passed as a JSON string (via our lib/blog.ts fix), parse it back
if (typeof data === 'string') {
try {
data = JSON.parse(data);
} catch (e) {
console.error('Failed to parse MDX block data:', e);
}
}
// Normalize type (Payload sometimes uses blockType in data)
const blockType = type || data?.blockType;