views:

177

answers:

2

I am developing Javascript app that will wrap every line of text entered inside iframe (designmode) with P (or div) like it happens by default in IE.

For now I am not pasting my code because I just started, the first problem is when i type some text in firefox and even before I click enter or calling any function firebug inserts

<br _moz_dirty="">

under the entered text.

Why? How can I prevent it?

If you still need my code please tell.

A: 

As the _moz_-prefix suggests, this is a Mozilla-internal property. It isn't inserted by Firebug, but rather by the core editor functionality in Gecko. You can't prevent it; ignore it or work around it.

Ms2ger
first I want to understand what causes it.
shivesh
A: 
#myEditableDiv br {display:none;}

It's something Mozilla uses to prevent empty containers collapsing and occasionally inserts at seemingly random times too.

The question is, if they knew it was a dirty hack then why did they do it?

Mattyod