Ticket #1605 (closed Bug: fixed)

Opened 6 years ago

Last modified 15 months ago

[Firefox] Unnecessary <p> tags are inserted in InsertHtml function of FCKEditor Object

Reported by: drsskelkar Owned by:
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.5
Keywords: Firefox Cc:

Description

Unnecessary <p> tags are inserted in InsertHtml function of FCKEditor Object. Suppose we insert HTML text programmatically as follows

var html_text = " This is <b>some <span style=\" color: maroon; \" >HTML</span></b> text " ; var ed = FCKeditorAPI.GetInstance('TEXT') ed.InsertHtml(html_text);

Than some extra <p> tags appear in the inserted text. ( confirmed by viewing HTML source )

This problem is seen only in Firefox 2/3 Beta ( Or any GECKO browser )

It is not seen with IE7 / Safari 3.04 or Opera 9.5 Tested on Windows XP SP2 Thanks

Attachments

TC_1605.html (1.1 KB) - added by w.olchawa 6 years ago.
A minimum sample page to reproduce the bug.

Change History

comment:1 Changed 6 years ago by w.olchawa

  • Keywords Pending WorksForMe added; Insert HTML extra P tag removed

Hi!

Could you please provide us the final output you are having in the reported test case? Please also indicate what you would expect to have.

Thanks

comment:2 Changed 6 years ago by drsskelkar

On your request I am providing link for test case: Just Click here: http://vrunda.dyndns.org/fcktest/index.html

Unnecessary <p> tags get inserted in Firefox only, not in other browsers. First click Insert HTML button. Click on "view source", and come back to normal view.

Then you will find one line inserted between words "some HTML " and "text with colors formatted."

comment:3 Changed 6 years ago by w.olchawa

Hi!

I was able to reproduce your problem on you page however my local testing doesn't didn't show any problem. My script:

<script type="text/javascript">
var oFCKeditor = new FCKeditor('FCKeditor1');
oFCKeditor.BasePath = "fckeditor/";
oFCKeditor.Height = 300 ;
oFCKeditor.Config["CustomConfigurationsPath"] = "/new/myconfig.js" 

oFCKeditor.Value	= '<p>Hello, I am Mister X ...<\/p>' ;
oFCKeditor.Create();
// This is a sample code for reproduction of bug #1605
function test1() {
var text = 'This is <b>some  <span style="color: maroon;">HTML</span></b> text with colors formatted.' ;
    FCKeditorAPI.GetInstance('FCKeditor1').InsertHtml(text);
    return false;}
</script>
</div>
  <br />
        <a href="javascript:void(0);" onclick="test1();">Test 1</a>
		

It works perfectly fine using versions 2.5.1, 2.6 beta ane the latest SVN.

comment:4 Changed 6 years ago by w.olchawa

  • Keywords Confirmed Firefox added; Pending WorksForMe removed
  • Summary changed from Unnecessary <p> tags are inserted in InsertHtml function of FCKEditor Object ( Only in FIREFOX ) to [Firefox] Unnecessary <p> tags are inserted in InsertHtml function of FCKEditor Object

Ok I reviewed your bug again. And I can defiantly confirm it. It seems it is related to oFCKeditor.ReplaceTextarea(); function because in other cases (as in the script above) it works OK.

I've attached a sample page for reproduction of this bug based on your sample page.

Thanks for investigating.

Changed 6 years ago by w.olchawa

A minimum sample page to reproduce the bug.

comment:5 Changed 6 years ago by drsskelkar

Persistent problem noticed even in IE7 and Safari, and other browsers that extra unwanted <p> get inserted around editor text when you switch back and forth between source view and WYSIWYG mode.

comment:6 Changed 15 months ago by Reinmar

  • Status changed from confirmed to closed
  • Resolution set to fixed

This issue expired.

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