Opened 16 years ago
Closed 12 years ago
#2781 closed Bug (invalid)
FckEditor InsertHtml inserts extra <p> tags
Reported by: | relish27 | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Output Data | Version: | FCKeditor 2.6.3 Beta |
Keywords: | Cc: |
Description
I've noticed lately that the FckEditor .InsertHTML call wraps the content in <p> tags. Is there a way to not have it do this? Because I open a new window for my editor, it keeps adding more and more <p> tags to the existing content. Is there a way around it?
Change History (5)
comment:1 Changed 16 years ago by
Keywords: | Pending added |
---|
comment:2 Changed 16 years ago by
Cc: | COURTNEYREMES@… added |
---|
Sure. Here's how I have my editors set up.
- 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.
- 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);
- 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.
comment:3 Changed 16 years ago by
Cc: | COURTNEYREMES@… removed |
---|
comment:4 Changed 16 years ago by
Component: | General → Core : Output Data |
---|---|
Keywords: | Confirmed added; Pending removed |
Version: | → FCKeditor 2.6.3 Beta |
Similar to #2526
comment:5 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | confirmed → closed |
Just like #2526, this one should not any more be reproducible. It's that's not the case, then we'll need a clearer TC to reproduce this in a plain editor installation.
Could you provide more details, sample code or steps to reproduce this bug?