@uniweb/build 0.1.24 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/prerender.js +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/build",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
package/src/prerender.js CHANGED
@@ -270,8 +270,12 @@ function PageRenderer({ page, foundation }) {
270
270
  function guaranteeContentStructure(parsedContent) {
271
271
  const content = parsedContent || {}
272
272
 
273
+ // Spread content first, then override with guaranteed structure
274
+ // This ensures main.body.paragraphs etc. are always arrays
273
275
  return {
274
- // Main content section
276
+ // Preserve any additional fields from parser
277
+ ...content,
278
+ // Main content section (override with guarantees)
275
279
  main: {
276
280
  header: {
277
281
  title: content.main?.header?.title || '',
@@ -288,8 +292,6 @@ function guaranteeContentStructure(parsedContent) {
288
292
  },
289
293
  // Content items (H3 sections)
290
294
  items: content.items || [],
291
- // Preserve any additional fields from parser
292
- ...content,
293
295
  }
294
296
  }
295
297