nuxt / nuxt/content

bug in mdx parser with named slots and bullets / <ul> does not render

Open
#3,803 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
3.7k
Forks
746
Avg merge
1d 16h
Merged PRs (30d)
3

Description

Environment
  • Operating System: Windows 10.0.19045
  • Node Version: v24.13.0
  • Nuxt Version: 4.4.4
  • Nitro Version: 2.13.4
  • CLI Version: 3.35.1
  • Package Manager: npm 11.6.2
  • Builder: vite 7.3.2
  • Runtime Modules: @nuxt/content 3.13.0, @nuxt/ui 4.7.1
  • Build Modules: -
  • User Config: compatibilityDate, content, css, devtools, modules, ui
Version

4.4.4

Reproduction

https://stackblitz.com/edit/github-utrxqy6c?file=content%2Findex.md

I tried to make a reproduction, however this is new for me.
I get errors with installing SQLLite what is new for me.

Description

When using bullet lists inside named slots of an MDC component, the rendering behavior is inconsistent.

The same markdown syntax (- item) renders as a proper <ul> in some slots, but (no <ul>) in others:
I tried to figure out before posting this if it was something i was doing wrong or if its a real bug.
See: https://github.com/nuxt/nuxt/discussions/35149

Rigth now the only viable workaround is wrapping it in divs.

code example:

BulletTest.vue


<template>
  <div>
    <div>
      <strong>slot-a: Renders UL</strong>
      <slot name="slot-a" />
    </div>
    <div>
      <strong>slot-b: does not render UL anymore</strong>
      <slot name="slot-b" />
    </div>
    <div>
      <strong>slot-c: if i indent it renders UL again</strong>
      <slot name="slot-c" />
    </div>
    <div>
      <strong>slot-d: but if i do it consistently again it doesnt render UL</strong>
      <slot name="slot-d" />
    </div>
    <div>
      <strong>slot-e: if i wrap it in div it works</strong>
      <slot name="slot-e" />
    </div>
    <div>
      <strong>slot-f: and for some reason the 2nd one also works</strong>
      <slot name="slot-f" />
    </div>
    <div>
      <strong>slot-g: but this one breaks again</strong>
      <slot name="slot-g" />
    </div>
    <div>
      <strong>slot-h: the only way to keep it consistent is to wrap all bullets in a div</strong>
      <slot name="slot-h" />
    </div>
    <div>
      <strong>slot-i:</strong>
      <slot name="slot-i" />
    </div>
    <div>
      <strong>slot-j:</strong>
      <slot name="slot-j" />
    </div>
    <div>
      <strong>slot-k: mg1986jp suggestion test with enter before and after</strong>
      <slot name="slot-k" />
    </div>
    <div>
      <strong>slot-l: mg1986jp suggestion test with enter before and after</strong>
      <slot name="slot-l" />
    </div>
    <div>
      <strong>slot-m: mg1986jp suggestion test with enter before and after</strong>
      <slot name="slot-m" />
    </div>
  </div>
</template>
       

bullettest.md

::bullettest

#slot-a
- item one
- item two
- item three

#slot-b
- item one
- item two
- item three

#slot-c
  - item one
  - item two
  - item three

#slot-d
  - item one
  - item two
  - item three

#slot-e
<div>

- item one
- item two
- item three

</div>
#slot-f
- item one
- item two
- item three

#slot-g
- item one
- item two
- item three

#slot-h
<div>

- item one
- item two
- item three
</div>

#slot-i
<div>

- item one
- item two
- item three
</div>

#slot-j
<div>

- item one
- item two
- item three
</div>

#slot-k

- item one
- item two
- item three

#slot-l

- item one
- item two
- item three

#slot-m

- item one
- item two
- item three

::
Additional context

Screenshots:

Image

Image

Image

Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction and compare the rendered output for the named slots in BulletTest.vue against the source sections in bullettest.md. Confirm which bullet-list layouts fail to produce a

    and whether the behavior is reproducible with the listed Nuxt Content version. Done means equivalent bullet lists render consistently across named slots without requiring wrapper divs.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, nuxt, typescript
Domain
content, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.