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
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user