Page MenuHomePhabricator

VE insert table conflict with unordered list not obvious to user
Closed, DuplicatePublic

Description

When inserting a table while using an unordered list the result is bad wikitext being inserted into the list item. I think this should either cancel the list item (make it unformatted text) or put the table into the list item. See GIF below

output-20170525152632.gif (339×480 px, 2 MB)

Event Timeline

Interesting. This is already supposed not to happen. This code should be preventing it:

// Tables in wikitext only work in some contexts, they're impossible e.g. in list items
ve.dm.MWTableNode.static.suggestedParentNodeTypes = [ 'document', 'div', 'tableCell', 'tableCaption', 'mwImageCaption' ];

Compare to a similar rule we have for headings, which works – trying to insert a heading in a list item will remove the list.

// Headings in wikitext only work in some contexts, they're impossible e.g. in list items
ve.dm.MWHeadingNode.static.suggestedParentNodeTypes = [ 'document', 'tableCell', 'div' ];