#471·nue

Nested content does not support lists when it's the first content

Author: goblinfactoryCreated Feb 1, 2025Updated Oct 15, 2025
Labelsnuemark

Describe the Bug

Nested content does not support lists and crashes with

logs
 | export function renderBlocks(blocks, opts = {}) {
16 |   return blocks.map(b => renderBlock(b, opts)).join('\n')
              ^
TypeError: undefined is not an object (evaluating 'blocks.map')
      at renderBlocks (/Users/alanhemmings/src/goblinfactory-limited/goblinfactory-blog-2024/node_modules/nuemark/src/render-blocks.js:16:10)
      at block (/Users/alanhemmings/src/goblinfactory-limited/goblinfactory-blog-2024/node_modules/nuemark/src/render-tag.js:28:38)
      at map (1:11)
      at renderBlocks (/Users/alanhemmings/src/goblinfactory-limited/goblinfactory-blog-2024/node_modules/nuemark/src/render-blocks.js:16:17)
      at render (/Users/alanhemmings/src/goblinfactory-limited/goblinfactory-blog-2024/node_modules/nuemark/src/parse-document.js:46:59)
      at renderPage (/Users/alanhemmings/src/goblinfactory-limited/goblinfactory-blog-2024/node_modules/nuekit/src/layout/page.js:131:28)
      at /Users/alanhemmings/src/goblinfactory-limited/goblinfactory-blog-2024/node_modules/nuekit/src/nuekit.js:127:22

Minimal Reproduction

Follow the getting started and create a new Emma Bennet blog.

Edit the Contact me markdown from

[.stack]
  # Contact me
  I'm currently available for hire

to

[.stack]
  - item 1
  - item 2
  I'm currently available for hire

and this will crash.

HINT Observe that adding in a header above the list item stops it from crashing. so only crashes when the first child content is a list. For example, this does NOT crash

[.stack]
  # Contact me
  - list item 1
  - list item 2
  I'm currently available for hire