Midas creates empty blocks as <></> when deleting text

RESOLVED DUPLICATE of bug 247276

Status

SeaMonkey
Composer
RESOLVED DUPLICATE of bug 247276
14 years ago
14 years ago

People

(Reporter: Santiago Bustelo, Unassigned)

Tracking

Trunk
PowerPC
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-0;en-US; rv:1.7) Gecko/20040614 Firefox/0.9

In a rich text editor, when deleting at the beginning or end of a block element, empty tags <></> are 
created and the blocks are broken (at least, on Firefox 0.9 over MacOS X).

If you have two Ps, e.g.
<p>line 1</p><p>line 2</p>
and press backspace while in the beginning of line 2 (or forward-delete at the end of line 1), you get 
something odd as:
<>line1<br> line2</>
instead of
<p>line 1 line 2</p>

Applying the following stylesheet to the document where designMode is "on":
BODY BODY{border:1px solid red;margin:2px;padding:2px}
reveals that the <></> above are actually <body></body> being filtered by midas when entering 
"source mode" in the Editor, after being created by the delete behavior.

The aforementioned stylesheet also reveals that further typing and deleting inside this blocks results in 
more <body></body> being created around the block.

Reproducible: Always
Steps to Reproduce:
1. You have two Ps: <p>line 1</p><p>line 2</p>
2a. Place the caret at the beginning of line 2 and press backspace, or
2b. place the caret at the end of line 1 and press forward delete.
Actual Results:  
3. Getting to "source mode" in the rich text editor shows something odd as:
<>line1<br> line2</>

Expected Results:  
The editor should have preserved the fist line P block:
<p>line 1 line 2</p>.

The problem seems to have its root in the way Midas deals with block elements.
No <></> or <body></body> should be inserted when editing/deleting text.

Comment 1

14 years ago

*** This bug has been marked as a duplicate of 247276 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.