Tiny MCE putting in extra text in Div tags

lisacabisa - October 10, 2009 - 01:49
Project:TinyMCE
Version:6.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

In one of my content items, the following is viewable on the edit node page for one of my fields that uses Tiny MCE (as part of Wysiwyg):

linen table skirts

This data is not in the database and seems to be generated as rendered for edit or view by TinyMCE.

I looked around and saw a couple references to this for WordPress, but that's it -- just 2 references to this issue...

Anyone have this experience or know what causes it? Not quite sure I follow (or agree) with what I saw on the Wordpress reports that it is caused by pasting double returns. That doesn't make sense to me.

#1

lisacabisa - October 10, 2009 - 01:52

Oops! Forgot to wrap my example in <code> tags.

Let's try that again:

<DIV id=_mcePaste style="LEFT: -10000px; OVERFLOW: hidden; WIDTH: 1px; POSITION: absolute; TOP: 0px; HEIGHT: 1px">linen table skirts</DIV>

#2

dman - October 10, 2009 - 01:58

Gawd.
I guess you pasted that in as a copy-paste from somewhere else? And that somewhere else had some formatting applied to it, and your browser/OS carried the 'style' along with it in the clipboard, and tinymce did the best it could with information provided...
OFTEN people expect some of the formatting from the original to come along with it if you copy between word docs etc, and WYSIWYG editors are trying to emulate that. Thing is, that doesn't work too well with HTML styles.

Quick fix is to copy from source, paste into a PLAIN text editor, then copy that plan text and place it into your WYSIWYG field.
Proper fix is to use the 'Paste as plain text' button. I think tinymce has one - may need to be enabled.

I'm pretty sure it's not GENERATED by tinyMCE itself - just replicated through GIGO.

#3

lisacabisa - October 10, 2009 - 05:41

It's possible. I don't know what the user did exactly who created this content; however, from looking in the DB at previous revisions I was able to determine that the text snippet that is now showing in that Div tab was deleted from a TinyMCE Wysiwyg field just above the one it is now appearing in.
In any case, what I really don't understand is how is it not in the database for that field? It is only on the rendered edit and view pages.
BTW, I have "Force Cleanup on Standard Paste" enabled.

#4

mastoll - October 13, 2009 - 15:07

I'm having a similar problem but am using FCKEditor.

I cut/paste the code from DreamWeaver's code view so I don't expect any styling to be hidden in it anywhere, but maybe there is; the original code was generated by FireWorks.

This is what I pasted into the content box (div, img, and map tags):

<div>
<img height="790" border="0" width="582" alt="" usemap="#m_flowchart" id="flowchart" src="http://cals.arizona.edu/arizonawet/teachersupport/sites/cals.arizona.edu.arizonawet.teachersupport/files/flow-chart.gif" name="flowchart" />
<map id="m_flowchart" name="m_flowchart">

This is what I see when I view the rendered source code (extra div w/ styling, added canvas tag, extra styling of the img tag):

<div>
<div style="padding: 0pt; background: transparent url(http://cals.arizona.edu/arizonawet/teachersupport/sites/cals.arizona.edu...) repeat scroll 0% 0%; display: block; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; position: relative; width: 582px; height: 790px;">
<canvas width="582" height="790" style="border: 0pt none ; padding: 0pt; width: 582px; height: 790px; position: absolute; left: 0pt; top: 0pt;"></canvas>
<img class="maphilighted" style="border: 0pt none ; padding: 0pt; opacity: 0; position: absolute; left: 0pt; top: 0pt;" alt="" usemap="#m_flowchart" id="flowchart" src="swap-rem-space_files/flow-chart.gif" name="flowchart" width="582" border="0" height="790">
<div />
<map id="m_flowchart" name="m_flowchart">

That closing div tag right before the map tag causes the map code to fall below the image and carve out a huge piece of blank page real estate.

#5

mastoll - November 10, 2009 - 20:09

My real problem here in the end had nothing to do with inserted code other than br tags at the end of every line, even if I butted the tags up against each other.

Thus I learned about Input Formats:
In order to prevent the insertion of spurious br tags, I went to administer>Site Configuration>Input Formats, clicked Configure for the Full HTML format, and un-checked the Filter option, "Line Break Converter."

 
 

Drupal is a registered trademark of Dries Buytaert.