Closed Bug 473984 Opened 16 years ago Closed 15 years ago

Composer adds <br> after <li> element and inside table cells causing poor rendering in non-mozilla browsers

Categories

(SeaMonkey :: Composer, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 333024

People

(Reporter: stevemcmillen, Unassigned)

Details

(Whiteboard: DUPEME !?)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090116 SeaMonkey/2.0a3pre
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090116 SeaMonkey/2.0a3pre

If you are typing in a list structure (e.g.):
<ul>
  <li>item 1</li>
  <li>item 2</li>
</ul>
with your cursor at the end of item 2 in "Normal" (WYSIWIG) view

a <br> is inserted after the close </li> tag as follows:
<ul>
  <li>item 1</li>
  <li>item 2</li>
  <li><br>
  </li>
</ul>

Typing some text into the new list entry you get the following:

<ul>
  <li>item 1</li>
  <li>item 2</li>
  <li>item 3<br>
  </li>
</ul>

The problem is this extra <br> element causes many browsers to add a carriage return in the middle of the list so list elements look like they are "double spaced".

Note: If you add yet another item, the <br> is removed but added again to the last item you just added.

However, adding <br> is not limited to the last item in a list.  If you put your cursor at the end of one of the items in the list (not the last) and type enter and type text, you'll get similar result.

For example, put your cursor after item 1 in the following:
<ul>
  <li>item 1</li>
  <li>item 2</li>
</ul>

Then type return and you get this:
For example, put your cursor after item 1 in the following:
<ul>
  <li>item 1</li>
  <li>item 1a<br>
  </li>
  <li>item 2</li>
</ul>

The list is left in this state and rendering looks bad in many browsers.

The problem is also true with tables.  For example, create a table as follows:

<table style="text-align: left; width: 100%;" border="1" cellpadding="2"
cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top;"><br>
</td>
<td style="vertical-align: top;"><br>
</td>
</tr>
<tr>
<td style="vertical-align: top;"><br>
</td>
<td style="vertical-align: top;"><br>
</td>
</tr>
</tbody>
</table>

By default the table has <br> tags in it and they do not go away.



Reproducible: Always

Steps to Reproduce:
The examples above should describe well enough the steps to reproduce but let me know if now and I'm happy to spell this out in detail.
Actual Results:  
See above in Details.

Expected Results:  
Composer should NOT add <br> tags as profusely as it does.  In fact, it should only insert a <br> element if the yser types return.

I'd REALLY REALLY like to see composer have a mode where you can select to use <p> elements exclusively when typing return instead of <br> elements.  The preference for "Return in paragraph always creates new paragraph" seems only to affect if you are already in a <p> element.

A big problem with <br> elements is that when you change sytle (e.g. set a bunch of lines to an unordered or ordered list (<ol> or <ul>) or you set the style to a heading or something, you end up with new lines where there should not be and they are difficult to remove w/o going to the source.

Note: I have the preference of "Return in paragraph always creates new paragraph" checked

I'd almost like to say this is a major annoyance in Composer and makes it far less functional as a good HTML editor than it could be but I'll refrain from setting the "Severity".
Whiteboard: DUPEME !?
Version: unspecified → Trunk
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.