Skip to content

Markdown: setContent issues when content only contains whitespace and slashes #7914

Description

@slmnsh

Affected Packages

markdown

Version(s)

3.25.0

Bug Description

If you try to parse / with contentType: markdown it throws following error:

RangeError: Invalid content for node doc: <>
    at _NodeType.checkContent (chunk-X36TMPZB.js?v=9ef6b9c8:2197:13)
    at _Node.check (chunk-X36TMPZB.js?v=9ef6b9c8:1504:15)
    at chunk-ZQYF7ISI.js?v=9ef6b9c8:1425:12
    at Array.forEach (<anonymous>)
    at chunk-ZQYF7ISI.js?v=9ef6b9c8:1424:11
    at Object.insertContentAt (chunk-ZQYF7ISI.js?v=9ef6b9c8:820:57)
    at chunk-ZQYF7ISI.js?v=9ef6b9c8:1754:19
    at Object.chainedCommand [as setContent] (chunk-ZQYF7ISI.js?v=9ef6b9c8:777:47)
    at input.tsx:123:12

Also if you try to parse \ it just returns empty string for some reason.

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

It should parse it as text node

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: markdownMarkdown parsing and serializationcomplexity: mediumModerate change, possibly multiple filesimpact: lowNo direct user impactstatus: triageNeeds initial review and categorization

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions