Donate Share January 2009: Project of the Month

TinyMCE

Tracker: Bugs

5 Paste from NOTEPAD broken on WebKit, incorrect in FF+ IE - ID: 2896255
Last Update: Attachment added ( pepiacebo )

User agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5)
Gecko/20091102 Firefox/3.5.5 GTB5
Screen info: 1280x1024x32

Description of problem:
See
https://sourceforge.net/tracker/?func=detail&aid=2866317&group_id=103281&at
id=635682

Steps to reproduce:
1. Download attached text file and open in NOTEPAD.
2. Ctrl-A (Select All), Ctrl-C (Copy) to place plain text version on
clipboard.
3. Go to FULL EXAMPLE on MoxieCode website in each browser cited below.
4. Select All, Delete to remove content from TinyMCE in each browser.
5. Click into TinyMCE instance and type Ctrl-V to Paste to plain text
content into TinyMCE's editor.
6. Click Edit HTML Source button to see the variations.

Results of Paste:
Chrome and Safari are not usable as is. Two copies of the content are
created: one is hidden but well structured with id="mcePaste"; the other is
visible but not structured correctly into paragraphs and is even missing
many of the br tags that you would expect.

Firefox puts the entire content into one paragraph filled with br tags.

IE combines double br's into a single p tag, but not if there is whitespace
between the br's, as in br nbsp br.

Related to
https://sourceforge.net/tracker/?func=detail&aid=2866317&group_id=103281&at
id=635682

From our internal documentation of the issue...

h1. TinyMCE Paste Behaviors

TinyMCE handles pasted content differently for Paste Styled Content pasted
via ctrl+V, Paste Plain Text Content via the "Paste as Plain Text"
button/dialog, and *Paste Plain Text via ctrl+V*.

# Browser interprets the Clipboard contents, before TinyMCE can access the
contents.
# TinyMCE grabs the browser's version of the Clipboard
#* access the Pre-processed version using paste_preprocess function
# TinyMCE processes this content based on TinyMCE's understanding of the
current browser
#* access the Post-processed version using paste_postprocess
# TinyMCE further processes content for insertion into the DOM, adding
either

Need more info on events? See {{Configuration Notes and Testing}}.

Note, TinyMCE processes pastecontent into the

h2. Plain Text Paste source file

*1st and 3rd line end in a single space. Blank lines following 3rd and 4th
line contain a single space.*

Use Edit to see actual text or download
https://redmine.jbanetwork.com/attachments/download/21007/plain_text_paste_
text.txt

<pre>
1 test plain text followed by single linebreaks
1 test plain text followed by single linebreaks
1 test plain text followed by single linebreaks
1 test plain text followed by single linebreaks
2 test plain text followed by double linebreaks

2 test plain text followed by double linebreaks

2 test plain text followed by double linebreaks

2 test plain text followed by double linebreaks

3 test plain text followed by triple linebreaks


3 test plain text followed by triple linebreaks


3 test plain text followed by triple linebreaks


3 test plain text followed by triple linebreaks


4 test plain text followed by 4 linebreaks



4 test plain text followed by 4 linebreaks



4 test plain text followed by 4 linebreaks



4 test plain text followed by 4 linebreaks




</pre>

h3. Default Firefox 3.5.5 Windows XP Version 2002 SP 2 (2.40 GHz Pentium 4
with 1.5 GB RAM)

*Paste Plain Text from Notepad to TinyMCE Full Example via ctrl+V* result
viewed in the HTML Source window
Use Edit or create your own to see actual text
http://tinymce.moxiecode.com/examples/full.php

<pre>
<p>1 test plain text followed by single linebreaks <br />1 test plain text
followed by single linebreaks<br />1 test plain text followed by single
linebreaks <br />1 test plain text followed by single linebreaks<br />2
test plain text followed by double linebreaks <br /><br />2 test plain text
followed by double linebreaks<br /><br />2 test plain text followed by
double linebreaks <br />&nbsp;<br />2 test plain text followed by double
linebreaks<br />&nbsp;<br />3 test plain text followed by triple linebreaks
<br /><br /><br />3 test plain text followed by triple linebreaks<br /><br
/><br />3 test plain text followed by triple linebreaks <br />&nbsp;<br
/>&nbsp;<br />3 test plain text followed by triple linebreaks<br
/>&nbsp;<br />&nbsp;<br />4 test plain text followed by 4 linebreaks <br
/><br /><br /><br />4 test plain text followed by 4 linebreaks<br /><br
/><br /><br />4 test plain text followed by 4 linebreaks <br />&nbsp;<br
/>&nbsp;<br />&nbsp;<br />4 test plain text followed by 4 linebreaks<br
/>&nbsp;<br />&nbsp;<br />&nbsp;<br /><br /></p>
</pre>

h3. Default IE 8.0.6001.18702IC Windows XP Version 2002 SP 2 (2.40 GHz
Pentium 4 with 1.5 GB RAM)

*Paste Plain Text from Notepad to TinyMCE Full Example via ctrl+V* result
viewed in the HTML Source window
Use Edit or create your own to see actual text
http://tinymce.moxiecode.com/examples/full.php

<pre>
<p>1 test plain text followed by single linebreaks <br />1 test plain text
followed by single linebreaks<br />1 test plain text followed by single
linebreaks <br />1 test plain text followed by single linebreaks<br />2
test plain text followed by double linebreaks</p>
<p>2 test plain text followed by double linebreaks</p>
<p>2 test plain text followed by double linebreaks <br />&nbsp;<br />2 test
plain text followed by double linebreaks<br />&nbsp;<br />3 test plain text
followed by triple linebreaks</p>
<p><br />3 test plain text followed by triple linebreaks</p>
<p><br />3 test plain text followed by triple linebreaks <br />&nbsp;<br
/>&nbsp;<br />3 test plain text followed by triple linebreaks<br
/>&nbsp;<br />&nbsp;<br />4 test plain text followed by 4 linebreaks</p>
<p>&nbsp;</p>
<p>4 test plain text followed by 4 linebreaks</p>
<p>&nbsp;</p>
<p>4 test plain text followed by 4 linebreaks <br />&nbsp;<br />&nbsp;<br
/>&nbsp;<br />4 test plain text followed by 4 linebreaks<br />&nbsp;<br
/>&nbsp;<br />&nbsp;</p>
</pre>

h3. Default Chrome 3.0.195.32 Windows XP Version 2002 SP 2 (2.40 GHz
Pentium 4 with 1.5 GB RAM)

*Paste Plain Text from Notepad to TinyMCE Full Example via ctrl+V* result
viewed in the HTML Source window
Use Edit or create your own to see actual text
http://tinymce.moxiecode.com/examples/full.php

<pre>
<p>&nbsp;</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1 test
plain text followed by single linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1 test
plain text followed by single linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1 test
plain text followed by single linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1 test
plain text followed by single linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2 test
plain text followed by double linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2 test
plain text followed by double linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2 test
plain text followed by double linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2 test
plain text followed by double linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3 test
plain text followed by triple linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3 test
plain text followed by triple linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3 test
plain text followed by triple linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3 test
plain text followed by triple linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">4 test
plain text followed by 4 linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">4 test
plain text followed by 4 linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">4 test
plain text followed by 4 linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">4 test
plain text followed by 4 linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<p>1 test plain text followed by single linebreaks&nbsp;1 test plain text
followed by single linebreaks1 test plain text followed by single
linebreaks&nbsp;1 test plain text followed by single linebreaks2 test plain
text followed by double linebreaks&nbsp;<br />2 test plain text followed by
double linebreaks<br />2 test plain text followed by double
linebreaks&nbsp;&nbsp;2 test plain text followed by double
linebreaks&nbsp;3 test plain text followed by triple linebreaks&nbsp;<br
/><br />3 test plain text followed by triple linebreaks<br /><br />3 test
plain text followed by triple linebreaks&nbsp;&nbsp;&nbsp;3 test plain text
followed by triple linebreaks&nbsp;&nbsp;4 test plain text followed by 4
linebreaks&nbsp;<br /><br /><br />4 test plain text followed by 4
linebreaks<br /><br /><br />4 test plain text followed by 4
linebreaks&nbsp;&nbsp;&nbsp;&nbsp;4 test plain text followed by 4
linebreaks&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;</p>
</pre>

h3. Default Safari 4.0.4 Windows XP Version 2002 SP 2 (2.40 GHz Pentium 4
with 1.5 GB RAM)

*Paste Plain Text from Notepad to TinyMCE Full Example via ctrl+V* result
viewed in the HTML Source window
Use Edit or create your own to see actual text
http://tinymce.moxiecode.com/examples/full.php

<pre>
<p>&nbsp;</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1 test
plain text followed by single linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1 test
plain text followed by single linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1 test
plain text followed by single linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1 test
plain text followed by single linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2 test
plain text followed by double linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2 test
plain text followed by double linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2 test
plain text followed by double linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2 test
plain text followed by double linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3 test
plain text followed by triple linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3 test
plain text followed by triple linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3 test
plain text followed by triple linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3 test
plain text followed by triple linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">4 test
plain text followed by 4 linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">4 test
plain text followed by 4 linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">4 test
plain text followed by 4 linebreaks&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">4 test
plain text followed by 4 linebreaks</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px;
width: 1px; height: 1px; overflow-x: hidden; overflow-y:
hidden;">&nbsp;</div>
<p>1 test plain text followed by single linebreaks&nbsp;1 test plain text
followed by single linebreaks1 test plain text followed by single
linebreaks&nbsp;1 test plain text followed by single linebreaks2 test plain
text followed by double linebreaks&nbsp;<br />2 test plain text followed by
double linebreaks<br />2 test plain text followed by double
linebreaks&nbsp;&nbsp;2 test plain text followed by double
linebreaks&nbsp;3 test plain text followed by triple linebreaks&nbsp;<br
/><br />3 test plain text followed by triple linebreaks<br /><br />3 test
plain text followed by triple linebreaks&nbsp;&nbsp;&nbsp;3 test plain text
followed by triple linebreaks&nbsp;&nbsp;4 test plain text followed by 4
linebreaks&nbsp;<br /><br /><br />4 test plain text followed by 4
linebreaks<br /><br /><br />4 test plain text followed by 4
linebreaks&nbsp;&nbsp;&nbsp;&nbsp;4 test plain text followed by 4
linebreaks&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;</p>
</pre>

h3. Expected

<pre>
<p>1 test plain text followed by single linebreaks </p>
<p>1 test plain text followed by single linebreaks</p>
<p>1 test plain text followed by single linebreaks </p>
<p>1 test plain text followed by single linebreaks</p>
<p>2 test plain text followed by double linebreaks </p>
<p>&nbsp;</p>
<p>2 test plain text followed by double linebreaks</p>
<p>&nbsp;</p>
<p>2 test plain text followed by double linebreaks </p>
<p>&nbsp;</p>
<p>2 test plain text followed by double linebreaks</p>
<p>&nbsp;</p>
<p>3 test plain text followed by triple linebreaks </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>3 test plain text followed by triple linebreaks</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>3 test plain text followed by triple linebreaks </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>3 test plain text followed by triple linebreaks</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>4 test plain text followed by 4 linebreaks </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>4 test plain text followed by 4 linebreaks</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>4 test plain text followed by 4 linebreaks </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>4 test plain text followed by 4 linebreaks</p>
</pre>


Pepi ( pepiacebo ) - 2009-11-11 21:58

5

Open

None

Nobody/Anonymous

None

None

Public


Comments

No follow-up comments have been posted.

Attached File ( 1 )

Filename Description Download
test_plain_text.txt Here is a plain text test file to OPEN in NOTEPAD. Download

Change ( 1 )

Field Old Value Date By
File Added 350517: test_plain_text.txt 2009-11-11 21:58 pepiacebo