Last modified: 2014-07-31 10:21:48 UTC
When editing a document that contains: * Foo * Bar * Baz Adding an attribute to one of the list items in VE doesn't roundtrip (they serialise back to * instead of forcing <ul><li>..</ul>, as it will have to). Right now VisualEditor never does this, but earlier today I was experimenting with this (the language inspector might need to do this to properly flip the directionality of an individual list item, wrapping the inner content is not an option as then the number would be on the wrong side). When trying to reproduce this I noticed that it also happens when creating a new document (e.g. there is no existing page, it has no reason to force "*" instead of "<li>" other than that being the preferred default for wikitext). http://parsoid.wmflabs.org/_html/: In: <div dir="ltr"> <ul> <li>a <li lang="he" dir="rtl">b <li>c </ul> </div> Out: <div dir="ltr"> * a * b * c </div> The only case where Parsoid kept the attributes is when not editing a document with wikitext, and not creating a new document, but when editing an existing document with "<li>" in wikitext already, it did roundtrip those.
Timo indicated on IRC that lists and list items will be first, but other elements will follow. We should try to use this first case to develop the general infrastructure. We will need to convert an entire list to HTML syntax if an attribute is set on either the list or any list item. Mixed templated / non-templated list items are discussed in bug 53368. We protect the entire list if any list item's bullets are template-generated. That means that we (thankfully!) won't have to consider that case here.