Skip to content

Web: images inside a link (or other inline container) render as block images #1081

Open

Description

@ericpoulinnz

Version: react-native-enriched-markdown 1.1.1, react-native-web 0.21

Markdown

Play [![](https://example.com/thumb.jpg) Catan](https://example.com/games/1) tonight

Expected: the image renders inline at markdownStyle.inlineImage.size, as it does on iOS and Android.

Actual: on web it gets the block image style and renders full size, breaking the line.

Cause: markInlineImages in src/web/utils.ts only marks images that are direct children of a Paragraph. An image inside a Link (or Strong, Emphasis, etc.) next to text is never marked isInline.

Suggested fix: any container whose children include non-image content holds its images inline. Markdown images are always inline-level, so this can't misclassify a real block image (a paragraph with only an image keeps its block behaviour):

 export function markInlineImages(node: ASTNode): void {
-  if (node.type === 'Paragraph' && node.children) {
+  if (node.children) {
     const hasNonImageChild = node.children.some(
       (child) => child.type !== 'Image'
     );

Activity

  1. eszlamczyk commented on Oct 26, 2026

    @eszlamczyk
    Collaborator

    Hi @ericpoulinnz, thanks for the report and the suggested fix! It looks like an easy one. This should be fixed before the next minor release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdomain: imagesImage rendering and cachinghelp wantedExtra attention is neededlibrary: react-nativeTasks that are specifically for react-native-enriched-markdownplatform: webAffects the web platformpriority: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions