MWTableNode: Apply wikitable class to pasted tables

Bug: T85577
Change-Id: I9714cf3e8ccc165f91af939481c845c3ec9c5f6b
This commit is contained in:
Ed Sanders 2016-01-22 18:43:47 +00:00
parent 3bc62ba61d
commit bf50e2a570

View file

@ -44,13 +44,18 @@ ve.dm.TableSectionNode.static.parentNodeTypes.push( 'mwTable' );
ve.dm.TableCaptionNode.static.parentNodeTypes.push( 'mwTable' );
ve.dm.TableRowNode.static.childNodeTypes.push( 'mwTransclusionTableCell' );
ve.dm.MWTableNode.static.toDataElement = function ( domElements ) {
ve.dm.MWTableNode.static.toDataElement = function ( domElements, converter ) {
var attributes = {},
dataElement = { type: this.name },
classAttr = domElements[ 0 ].getAttribute( 'class' );
this.setClassAttributes( attributes, classAttr );
// Default to wikitable when pasting
if ( converter.isFromClipboard() ) {
attributes.wikitable = true;
}
if ( !ve.isEmptyObject( attributes ) ) {
dataElement.attributes = attributes;
}