Opened 9 years ago

Closed 8 years ago

#1150 closed Bug (fixed)

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

Reported by: martinkou Owned by: martinkou
Priority: Normal Milestone: FCKeditor 2.6.3
Component: General Version: SVN (FCKeditor) - Retired
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 (1)

1150.patch (1.4 KB) - added by martinkou 8 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 9 years ago by martinkou

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

Fixed with [755].

Click here for more info about our SVN system.

comment:2 Changed 9 years ago by cap

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:3 Changed 9 years 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)

comment:4 in reply to: ↑ description Changed 9 years 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

comment:5 Changed 9 years 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

comment:6 Changed 8 years 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)

comment:8 Changed 8 years 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.

comment:9 Changed 8 years 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 8 years ago by martinkou

comment:10 Changed 8 years 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.

comment:11 Changed 8 years ago by martinkou

  • Owner set to martinkou
  • Status changed from reopened to new

comment:12 Changed 8 years ago by martinkou

  • Status changed from new to assigned

comment:13 Changed 8 years 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.

comment:14 follow-up: Changed 8 years 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'.

comment:15 in reply to: ↑ 14 Changed 8 years ago by styu

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

comment:16 Changed 8 years ago by fredck

  • Keywords Review+ added; Review? removed

comment:17 Changed 8 years ago by fredck

  • Milestone set to FCKeditor 2.6.3

comment:18 Changed 8 years ago by martinkou

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

Fixed with [2219].

Click here for more info about our SVN system.

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