Opened 17 years ago

Closed 17 years ago

Last modified 14 years ago

#211 closed Bug (fixed)

Firefox: Unclosed <p> tag results in cursor not showing up and can't focus into editor

Reported by: Brian Klug Owned by:
Priority: Normal Milestone: FCKeditor 2.4.1
Component: General Version: FCKeditor 2.4
Keywords: Confirmed Firefox Cc:

Description

  1. Load demo @ http://www.fckeditor.net/demo or from SVN
  1. Switch to source mode and enter the following:
<p>
  1. Switch back to normal mode

The cursor disappears. You can't focus into editor.

Do I win a prize for "shortest markup that causes a bug"? :)

Change History (7)

comment:1 in reply to:  description Changed 17 years ago by Frederico Caldeira Knabben

Keywords: Confirmed added
Version: FCKeditor 2.4

Confirmed with FF2. Ok with IE.

Replying to dustball:

You should remove the source button for users who insert that kind of markup in the editor :) We expect that people who uses it to have a minimum "respect for our dear HTML".

The cursor disappears. You can't focus into editor.

For now, just start typing and you will see that the cursors will magically appear. It a Firefox bug on editing mode.

Do I win a prize for "shortest markup that causes a bug"? :)

You certainly won it :)

comment:2 Changed 17 years ago by Brian Klug

It a Firefox bug on editing mode.

Ok! We will work around the bug. For us, the problem happens when the editor is first loaded with a <p>. We'll just make sure that doesn't happen. I haven't been able to reproduce the bug any other way.

We expect that people who uses it to have a minimum "respect for our dear HTML".

Hmmm, have you been drinking? :)

In seriousness, most of our users don't even know what HTML is, let alone will ensure valid HTML at all times. The problem really comes when users cut & paste richtext from other applications. The MS-Word paste detection is nice, but only works with IE as you know. Also, it is possible to copy invalid markup from a web page, I suspect.

But that is just for discussions sake - we'll workaround this bug.

comment:3 in reply to:  2 Changed 17 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.4.1
Resolution: fixed
Status: newclosed

Replying to dustball:

It a Firefox bug on editing mode.

Ok! We will work around the bug. For us, the problem happens when the editor is first loaded with a <p>. We'll just make sure that doesn't happen. I haven't been able to reproduce the bug any other way.

We expect that people who uses it to have a minimum "respect for our dear HTML".

Hmmm, have you been drinking? :)

Yes... I think I was really drunk when I wrote it :)))

In seriousness, most of our users don't even know what HTML is, let alone will ensure valid HTML at all times. The problem really comes when users cut & paste richtext from other applications. The MS-Word paste detection is nice, but only works with IE as you know. Also, it is possible to copy invalid markup from a web page, I suspect.

It could happen to have bad code, but I really don't believe it is related with the "<p>" case. The only way you will find to reproduce it is to paste it in the source view, or load it at startup, "from a source not generated with FCKeditor". The editor will never produce "<p>". Please correct me if I'm wrong.

But that is just for discussions sake - we'll workaround this bug.

Well... it seams that the fix for it is just a simple "?" addition in a regular expressions. So here it is: fixed with [197].

comment:4 Changed 17 years ago by Brian Klug

It could happen to have bad code, but I really don't believe it is related with the "<p>" case. The only way you will find to reproduce it is to paste it in the source view, or load it at startup, "from a source not generated with FCKeditor". The editor will never produce "<p>". Please correct me if I'm wrong.

You are right. I was thinking of other cases.

Thanks for the fix!

comment:5 Changed 17 years ago by Alfonso Martínez de Lizarrondo

Resolution: fixed
Status: closedreopened

This fix has made it impossible to load the editor in Firefox with just some comment or anything that will get protected (scripts, special markup) and converted into a comment.

Switch to source mode and add this:

<!-- test -->

switch back to WYSIWYG and the content is just a <br>, I would suggest to change the EmptyParagraph regexp to

    /^<(\w+)[^>]*>\s*(<\/\1>)?$/

as a way to avoid messing with comments.

comment:6 Changed 17 years ago by Alfonso Martínez de Lizarrondo

The proposed regexp will still make lose the contents if it's for example just an image.

comment:7 Changed 17 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: reopenedclosed

Thanks for the comments Alfonso. It should have been now fixed with [247].

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy