Skip to content

Plain text paste does not preserve line breaks — multi-line text is flattened into a single paragraph #2693

@yannishin

Description

@yannishin

What’s broken?

When pasting plain text containing line breaks (\r\n / \n) into the BlockNote editor, the line breaks are not preserved. All lines are flattened into a single paragraph, separated only by spaces.

This is reproducible on the official demo site (https://www.blocknotejs.org/demo) without any custom configuration.

What did you expect to happen?

Each line in the pasted plain text should map to a separate paragraph block (or at minimum a soft line break). Plain text line breaks carry meaning and should not be collapsed into spaces.

Steps to reproduce

  1. Open Windows Notepad (or any plain-text source — Notepad++, terminal output, etc.) and type the following on separate lines:
   line1
   line2
   line3
   line4
  1. Select all and copy (Ctrl+C)
  2. Open https://www.blocknotejs.org/demo
  3. Click into the editor and paste (Ctrl+V)

Actual result: A single paragraph — line1 line2 line3 line4

Expected result: Four separate paragraph blocks, one per line.

Image Image

BlockNote version

No response

Environment

No response

Additional context

  • Source: Windows Notepad / Notepad++ (CRLF), also reproduces from other plain-text sources
  • Target: https://www.blocknotejs.org/demo
  • macOS Chrome and Windows Chrome both reproduce
  • Default configuration, no custom paste handlers

Contribution

  • I'd be interested in contributing a fix for this issue

Sponsor

  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖

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