Opened 4 years ago

Last modified 4 years ago

#1615 new defect

Changing heading type in a list creates nested headings

Reported by: ejucovy Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version: trunk
Severity: normal Keywords:
Cc:

Description

To reproduce:

  1. Create a bulleted list and enter some text in the first list item. (HTML: <ul><li>Foo</li></ul>
  2. Put the cursor anywhere inside the list item
  3. Press ctrl+1 or use the Headings dropdown to make the text an <h1>. (HTML: <h1><ul><li>Foo</li></ul></h1>
  4. Press ctrl+2 to make the text an <h2> instead.

The HTML will now be: <h1><h2><ul><li>Foo</li></ul></h2></h1>

The expected behavior would be to replace the H1 tag with an H2 tag.

That said, I think there's also a bug earlier in these steps: the <h1> should be wrapped around the contents of the current <li>, rather than wrapping the entire <ul>. This is (slightly) more likely to be the user's intention, and http://stackoverflow.com/a/5014827/689985 suggests that the latter is valid HTML while the former is invalid.

Change History (1)

comment:1 Changed 4 years ago by ejucovy

This bug exists using Chrome 31.0.1650.63.

It does not exist using Firefox 26.0 -- in that browser, the behavior is exactly as it should be, per the last paragraph of the ticket. (Resulting HTML is <ul><li><h2>Foo</h2></li></ul> in Firefox.)

Note: See TracTickets for help on using tickets.