Handle parsing of unknown/custom elements in parse.ts and bump API package version to 1.32.1

This commit is contained in:
MartinBraquet
2026-04-05 15:43:43 +02:00
parent 757ec77574
commit e61ac9b3ff
2 changed files with 9 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@compass/api",
"version": "1.32.0",
"version": "1.32.1",
"private": true,
"description": "Backend API endpoints",
"main": "src/serve.ts",

View File

@@ -261,6 +261,14 @@ function parseBlockElement(
return {type: '__fragment', content: inner} as any
}
// Unknown/custom elements — try to parse as container (e.g., <projectcontent>, <bodycopy>)
if (el.children.length > 0) {
const inner = parseBlockElements(el.children, classStyles)
if (inner.length === 0) return null
if (inner.length === 1) return inner[0]
return {type: '__fragment', content: inner} as any
}
return null
}