Skip to content

Rich text preview omits block images nested in list items #7898

Description

@marthesselink

Describe the bug

Decap CMS 3.15.0 preserves block images nested in list items in the rich text editor after #7896, but the preview pane omits those images. The saved Markdown remains correct; this is a separate preview rendering issue.

To reproduce

Use a rich text field containing:

1. First step.
2. Last step.

   ![Screenshot](/img/screenshot.png)

The editor displays the image under the second list item, but the preview shows only the list text.

Expected behavior

The preview renders the image under the second list item.

Root cause

remarkRehypeShortcodes only transforms shortcodes among the root node children. The built-in image component is represented as a shortcode, so an image nested under list > listItem reaches remark-rehype untransformed and is dropped from the preview output.

Version

Decap CMS 3.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions