Ticket #1150 (closed Bug: fixed)

Opened 15 months ago

Last modified 5 months ago

<br type="_moz" /> appearing in Source mode

Reported by: martinkou Owned by: martinkou
Priority: Normal Milestone: FCKeditor 2.6.3
Component: General Version: SVN
Keywords: Confirmed Firefox Opera Safari Review+ Cc:

Description

Reproduction Procedure:

  1. Go to sample12.html
  2. Change Enter mode to BR
  3. Ctrl-A, Delete in the document to delete everything
  4. Type "line1" <Enter>
  5. Type "line2" <Enter>
  6. Type "line3" <Enter>
  7. Switch to Source mode
  8. Switch back to WYSIWYG mode
  9. Go to the end of the document, press Enter
  10. Switch to Source mode
  11. Now the last line of the HTML code reads "<br type="_moz" />".. which shouldn't happen.

The issue can be reproduced on Opera, Firefox and Safari

Attachments

1150.patch (1.4 KB) - added by martinkou 6 months ago.

Change History

  Changed 15 months ago by martinkou

  • status changed from new to closed
  • resolution set to fixed

Fixed with [755].

Click here for more info about our SVN system.

  Changed 12 months ago by cap

  • status changed from closed to reopened
  • resolution fixed deleted

I have downloaded the version 2.5 (30 novembre 2007) and I still see this bug (I have followed the Reproduction procedure).

Thank you and best regards.

Antonio

  Changed 12 months ago by cap

I am using Firefox (Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11)

in reply to: ↑ description   Changed 11 months ago by mem

FCKeditor 2.5.1

After the page load, all empty textareas contain <br type="_moz"> in Firefox 2.0.0.11, and &nbsp; in Opera

  Changed 11 months ago by mem

Firefox quick solution (i don't know if it's the best, but it works)

Open: fckeditor/editor/js/fckeditorcode_gecko.js Row: 48 Find: I='<br type="_moz">';this._BodyHTML=I; Replace with: I=' ';this._BodyHTML=I; Note: Do not place an empty I value (I=), the editor will disappear

  Changed 10 months ago by pgoddijn

this seems to originate in _source/classes/fckeditingarea.js line:80 ========= / If nothing in the body, place a BOGUS tag so the cursor will appear.

if ( FCKBrowserInfo.IsGecko && ( sBody.length == 0 FCKRegexLib.EmptyParagraph.test( sBody ) ) ) sBody = '<br type="_moz">' ; =========

wich seems to en in the compacted fckeditor.js at line 48 like Mem in the previous reply mentioned.

his quick solution seems to work, but at the cost of getting focus in the edit window. (the &nbsp remains there tho)

  Changed 10 months ago by pgoddijn

  Changed 8 months ago by camwheel

I have been able to reproduce this bug in both Firefox, and oddly enough in IE7 when using the list control. If you hit enter twice to leave the list in either browser, <br type="_moz" /> is tacked on in the last line in source view.

  Changed 7 months ago by shala

An other way to get this <br type="_moz" /> (using FF and FCK 2.6 with EnterMode: p) :

1/ Type line1 and <Enter> a few times (to generate some paragraphs")
2/ Type line2
3/ Select all and make the text bold

Here is the output when looking with source view :

<p><strong>&nbsp;line1<br /></strong></p>
<p><strong><br type="_moz" /></strong></p>
<p><strong><br type="_moz" /></strong></p>
<p><strong>line2<br type="_moz" /></strong></p>

Changed 6 months ago by martinkou

  Changed 6 months ago by martinkou

  • keywords Review? added

The <br> tag itself should be harmless - both the one that got appended towards the end of document, and the one that got inserted inside empty block tags (it was actually added there to prevent the block tag from becoming invisible in editor mode). The problem is the type="_moz" attribute.

I'm proposing a patch to properly remove such attribute values from the source code.

  Changed 6 months ago by martinkou

  • owner set to martinkou
  • status changed from reopened to new

  Changed 6 months ago by martinkou

  • status changed from new to assigned

  Changed 6 months ago by ikrieg

Patch keeps the type="_moz" attribute from surfacing for me. However, it seems like it would be appropriate to remove the entire tag, at least when it's truly bogus, and that does not happen. Should it just return false even if there is no nextSibling, perhaps, or is more complex logic needed? Certainly if it's at the end of the document and it's bogus, it should be removed. Not as big a deal as what the patch already addresses, though.

follow-up: ↓ 15   Changed 5 months ago by styu

Patch doesn't works for me on FF3 and FF2. When EnterMode is 'p', then '<p>&#160;</p>' appears in source mode, and '<br type="_moz" />' appears, when EnterMode='br'.

in reply to: ↑ 14   Changed 5 months ago by styu

Sorry for my post. I haven't used the fcksource=true url parameter. Now it inserts only <br/ >

  Changed 5 months ago by fredck

  • keywords Review+ added; Review? removed

  Changed 5 months ago by fredck

  • milestone set to FCKeditor 2.6.3

  Changed 5 months ago by martinkou

  • status changed from assigned to closed
  • resolution set to fixed

Fixed with [2219].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.