From 9d83efc747573e8acd16ca1dea63e6764275aaa0 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Thu, 27 Apr 2017 18:30:23 +0100 Subject: [PATCH] Specify suggested parent node types for tables This won't do anything useful until T164017 is resolved. Bug: T164016 Change-Id: I39bffe2dc59a97888b81bdbe990e55ba95b0dd94 --- modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js index ebb09f41d8..bdd8556f91 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js @@ -41,6 +41,9 @@ ve.dm.MWTableNode.static.classAttributes = { 'mw-collapsed': { collapsed: true } }; +// 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' ]; + // HACK: users of parentNodeTypes should be fixed to check for inherited classes. ve.dm.TableSectionNode.static.parentNodeTypes.push( 'mwTable' ); ve.dm.TableCaptionNode.static.parentNodeTypes.push( 'mwTable' );