Closed Bug 1121427 Opened 9 years ago Closed 4 years ago

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

Categories

(developer.mozilla.org Graveyard :: Editing, defect)

All
Other
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: sphinx_knight, Unassigned)

References

Details

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

Attachments

(2 files)

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
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
(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)
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
Severity: normal → minor
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: