#4786·summernote

Copy-Paste Adds Text on New Line Due to Hidden Line Break

Author: JerishacatherinRBCreated Jan 27, 2026Updated Sep 13, 2026

Checklist

  • I've looked at the documentation to make sure the behavior isn't documented and expected.
  • I'm sure this is an issue with Summernote, not with my app or other dependencies (Angular, Cordova, React, etc.).
  • I've searched through the current issues to make sure this hasn't been reported yet.
  • My issue is pertinent to this repository of Summernote (jQuery), or I was unable to have my issue resolved from the relevant version I'm using, such as Angular, dJango, Rails or React. Please try your issue at the relevent repository first.
  • I understand that issues without interaction for more than 14 days (2 weeks), may be closed at our discretion. We do this, as sometimes issues are abandoned. We may at our discretion, add issues to the relevant project to be looked at, or for maintainers to work through as time permits. This is to help keep issues relevant to the current version of Summernote, and to reduce clutter.
  • I agree to follow the Code of Conduct that this project adheres to.

Steps to reproduce

  1. Open Summernote editor.
  2. Enter some text in the editor with line breaks.
  3. Select and copy the text.
  4. Paste the copied text at another position in the same editor.
  5. Observe that the pasted text appears on a new line.
  6. For example here I copied the Line 2 and pasted near to Line 2 but it added line break and moved to next line
Image

Expected behavior

When pasting copied text, it should be inserted at the current cursor position without adding a new line.

The pasted content should appear inline and behave consistently across browsers.

Current behavior

When text is copied, it sometimes includes a hidden line break.

Browser Difference:

  • In Chrome, the hidden line break is highlighted/visible when selecting and copying text, so it is noticeable.
Image
  • In Firefox, the hidden line break is not highlighted or visible, so users may unknowingly copy it.
Image

As a result, when the content is pasted in Firefox, it may contain a hidden line break and is inserted on a new line instead of at the cursor position.

This causes inconsistent copy-paste behavior and formatting issues.

Minimal example reproducing the issue

No response

Environment

Summernote version: 0.9 Browser (with version): Chrome 138.0.7204.101 Browser (with version):firefox 146.0.1 (64-bit) OS/Platform (with version): Windows 11