Skip to content

Nested block content controls are dropped during layout conversion #3745

Description

@tom-material

What happened?

SuperDoc drops nested block w:sdt content controls when converting to flow
blocks.

Steps to reproduce

Minimal repro shape:

<w:sdt>
  <w:sdtPr>
    <w:alias w:val="Outer Content Control"/>
    <w:tag w:val="outer_content_control"/>
    <w:id w:val="1001"/>
  </w:sdtPr>
  <w:sdtContent>
    <w:p><w:r><w:t>Outer paragraph before.</w:t></w:r></w:p>

    <w:sdt>
      <w:sdtPr>
        <w:alias w:val="Inner Content Control"/>
        <w:tag w:val="inner_content_control"/>
        <w:id w:val="1002"/>
      </w:sdtPr>
      <w:sdtContent>
        <w:p><w:r><w:t>Inner paragraph.</w:t></w:r></w:p>
      </w:sdtContent>
    </w:sdt>

    <w:p><w:r><w:t>Outer paragraph after.</w:t></w:r></w:p>
  </w:sdtContent>
</w:sdt>

Expected: the inner content control content and metadata are preserved/
rendered.

Actual: the outer content control renders, but the nested block SDT subtree
is skipped.

The loss appears to happen in handleStructuredContentBlockNode, which
handles paragraphs, tables, and transparent wrappers, but not direct child
structuredContentBlock nodes.

[minimal-nested-block-sdt.docx](https://github.com/user-attachments/files/29022517/minimal-nested-block-sdt.docx)

### SuperDoc version

master

### Browser

None

### Additional context

_No response_

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions