Closed
Bug 277967
Opened 20 years ago
Closed 20 years ago
Nested lists (ul/ol/li) aren't valid (rich text editor)
Categories
(Core :: DOM: Editor, defect)
Tracking
()
People
(Reporter: greut.lists, Assigned: mozeditor)
Details
(Whiteboard: midas)
The Midas implementation isn't making goog html/xhtml (well-formed but not valid). DTD said : <!ELEMENT ul (li)+> <!ELEMENT ol (li)+> Step to reproduce : 1) pick a rich text editor (http://www.kevinroth.com/rte/demo.htm) 2) build some nested lists like : * A * B * C 3) look at the source code (here the result) <ul> <li>A</li> <ul> <li>B</li> </ul> <li>C</li> </ul>
Reporter | ||
Comment 1•20 years ago
|
||
Looking at the spec the resould should be (in xhtml) : <ul> <li>A <ul> <li>B</li> </ul> </li> <li>C</li> </ul> or (html valid) : <ul> <li>A <ul> <li>B </ul> <li>C </ul> a solution (with regex or other) : 1) Deleting every </li> 2) Replace : * </ul> -> </li></ul> * </ul><li> -> </ul></li></ul> * (?!<ul>)<li> -> </li><li> (a <li> not preceded by a <ul>)
Reporter | ||
Comment 2•20 years ago
|
||
(In reply to comment #1) > * </ul><li> -> </ul></li></ul> </ul><li> -> </ul></li><li> Sorry
Comment 3•20 years ago
|
||
Do either of you happen to know if this is a regression? The output generated by Composer doesn't pass the validator @w3.org but I swear it did long ago. Any ideas or am I thinking of something else? I haven't tested this on a recent trunk build (I see it in Mozilla 1.7.3 on Mac).
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Whiteboard: midas
Comment 4•20 years ago
|
||
This is not a regression. Duping to bug 54479 *** This bug has been marked as a duplicate of 54479 ***
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Updated•20 years ago
|
Status: RESOLVED → VERIFIED
Comment 5•20 years ago
|
||
this PHP code correct the misteaks $html = preg_replace("#</li>#","",$html); while( preg_match("#</ul>[^>]*<ul>[^>]*<ul>#",$html) ) { $html = preg_replace("#</ul>[^>]*<ul>[^>]*<ul>#","<ul>",$html); } $html = preg_replace("#</ul>#","</li></ul>",$html);
You need to log in
before you can comment on or make changes to this bug.
Description
•