#2781: FckEditor InsertHtml inserts extra <p> tags
----------------------+-----------------------------------------------------
Reporter: relish27 | Owner:
Type: Bug | Status: new
Priority: Normal | Milestone:
Component: General | Version:
Keywords: Pending |
----------------------+-----------------------------------------------------
Changes (by relish27):
* cc: courtneyre...@… (added)
Comment:
Sure. Here's how I have my editors set up.
1. Because there might be multiple on a page and it takes a while to load
them, I have a button next to the textarea that pops open a window with an
FCKeditor in it. It pulls in any content that may already have been in
the textarea.
2. Once the editor instance has loaded, there is some javascript that
grabs textarea content using the page opener, form, and field names.
var oEditor = FCKeditorAPI.GetInstance('MYFCKEditor');
var contentValue = eval("opener.document.<%=form%>.elements.<%=field%>");
MYFCKEditor.InsertHtml(contentValue.value);
3. When you click save, it passes the edited content back to the opener
page, form, and field as raw HTML.
BUT - back to #2. I noticed that if I already had HTML-formatted text in
my textarea from the start, when I got to #2, it would wrap the content in
<p> tags. I also tried inserting the content (contentValue above) into a
regular textarea on that popup, and found that it *wasn't* getting wrapped
in the <p> tags. So then I knew it was the InsertHtml function that was
doing it.
Yesterday I looked around at some of the docs and found there is another
function, SetData, which seems to do what I want it to do -- just pass the
content without doing any formattting.
MYFCKEditor.SetData(contentValue.value);
I've already implemented this on one client site and they are very happy
about the change. I have been using the FCKeditor for years in the same
exact way and it was only with the 2.6.3 version that this started
happening.
Thanks.
--
Ticket URL: <http://dev.fckeditor.net/ticket/2781#comment:2>
FCKeditor <http://www.fckeditor.net/>
The text editor for Internet
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac