Skip to content

rehypeExternalLinks plugin doesn't work as expected #927

@samgold2020

Description

@samgold2020

Initial checklist

Affected package

rehypeExternalLinks

Steps to reproduce

  • Install react-markdown version 10.0.1 or later
  • Use the following code to reproduce the error:
                    <Markdown
                        rehypePlugins={[
                            rehypeRaw,
                            rehypeSanitize,
                            rehypeExternalLinks({ target: "_blank" }),
                        ]}
                    >
                        {"some text"}
                    </Markdown>

Actual behavior

Typeerror occurs in UI

Uncaught TypeError: Cannot use 'in' operator to search for 'children' in undefined

Expected behavior

Expecting a text with attached associated link to be visible and open in a new tab when clicked

Runtime

Node.js 22.14.0

Package manager

yarn 4.9.2

Operating system

Mac OS Sonoma 14.6

Build and bundle tools

webpack

Metadata

Metadata

Assignees

No one assigned

    Labels

    👎 phase/noPost cannot or will not be acted on🙋 no/questionThis does not need any changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions