If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[CKEditor 4] Pasting text with 2+ new lines in <pre> ends the tag and insert non-preformated text

UNCONFIRMED
Unassigned

Status

Mozilla Developer Network
Editing
--
minor
UNCONFIRMED
3 years ago
3 years ago

People

(Reporter: Julien G, Unassigned)

Tracking

(Blocks: 1 bug)

Details

(Whiteboard: [specification][type:bug])

Attachments

(2 attachments)

(Reporter)

Description

3 years ago
What did you do?
================
1. Opened https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Array/push$edit 
2. Copied the en-US example in my text editor to edit it conveniently
3. Used the toolbar to create a <pre> zone along with JS brush for syntax highlighting
4. Pasted the result in the article

What happened?
==============
The pasted text appears "normal" instead of preformated.
If I read the source: the <pre> tag has been closed and the pasted text is enclosed with <p> tags (like "normal" text)

What should have happened?
==========================
The pasted text should have been inserted in the preformated zone so that the example is well-formed.

Is there anything else we should know?
======================================
I took care of copying the example code in Sublime Text to edit it before pasting it back to the edit zone. This avoids clipboard issues and the content of the clipboard is plain text.

As far as I'm aware, this did not happen before the CKEditor 4 upgrade
(Reporter)

Comment 1

3 years ago
This appears only when the text has a newline in it.
So:

"var foo='bar';" 
will be pasted correctly

"var foo='bar'; //<- New line here
var baz='ee';" 

won't be pasted correctly
Component: General → Editing
(Reporter)

Comment 2

3 years ago
(In reply to Julien G from comment #1)
> This appears only when the text has a newline in it.
> So:
> 
> "var foo='bar';" 
> will be pasted correctly
> 
> "var foo='bar'; //<- New line here
> var baz='ee';" 
> 
> won't be pasted correctly
Erratum:
This occurs when at least *two new lines* are used.
"var foo='bar';

var baz='ee';"

Precision:
Same issue using CR LF or LF or CR (if it might help)
(Reporter)

Updated

3 years ago
Summary: [CKEditor 4] Pasting text in <pre> ends the tag and insert non-preformated text → [CKEditor 4] Pasting text with 2+ new lines in <pre> ends the tag and insert non-preformated text
(Reporter)

Comment 3

3 years ago
Created attachment 8548875 [details]
example before pasting the code
(Reporter)

Comment 4

3 years ago
Created attachment 8548876 [details]
example : result after pasting text with multiple new lines
Blocks: 1032827

Updated

3 years ago
Severity: normal → minor
You need to log in before you can comment on or make changes to this bug.