Skip to content

[Proposal] Add support to import markdown string (same as import JSON) #80

@CrazyMillerGitHub

Description

@CrazyMillerGitHub

Hey everyone!

The LexicalMarkdown plugin currently supports exporting the editor's node tree to a Markdown string via LexicalMarkdown.generateMarkdown(from:selection:), but there is no corresponding API to import a Markdown string back into the editor. This means there is no parity with the JSON workflow, which supports both EditorState.toJSON() and EditorState.fromJSON(json:editor:).

Why it may be useful?

  • Round-trip support: Users who export Markdown should be able to re-import it, enabling use cases like persistence, clipboard paste-as-Markdown, and inter-app content transfer.
  • Parity with JSON: JSON already has full import/export. Markdown should follow the same pattern.
  • Common use case: Many apps need to load content authored externally in Markdown. Also as Lexical not supported by all platforms, it may be useful to store it as something that understandable for all platforms

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