Opened 10 years ago

Closed 6 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 10 years ago by Artur Formella

Keywords: Pending added

Could you provide more details, sample code or steps to reproduce this bug?

comment:2 Changed 10 years ago by relish27

Cc: COURTNEYREMES@… added

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.
  1. 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);

  1. 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 10 years ago by relish27

Cc: COURTNEYREMES@… removed

comment:4 Changed 10 years ago by Artur Formella

Component: GeneralCore : Output Data
Keywords: Confirmed added; Pending removed
Version: FCKeditor 2.6.3 Beta

Similar to #2526

comment:5 Changed 6 years ago by Frederico Caldeira Knabben

Resolution: invalid
Status: confirmedclosed

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.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy