Skip to content

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

Description

@matthy123

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: nuxt/nuxt#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions