mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Allow for mw.body being null in <selfclosing/> extensions
Bug: T173016 Change-Id: I8daa65e5dc0368b366710f044b621287e83e26f7
This commit is contained in:
parent
21759ac8c9
commit
51207e7aa5
|
@ -75,14 +75,16 @@ ve.ui.MWExtensionWindow.prototype.getInputPlaceholder = function () {
|
|||
ve.ui.MWExtensionWindow.prototype.getSetupProcess = function ( data, process ) {
|
||||
data = data || {};
|
||||
return process.next( function () {
|
||||
var dir;
|
||||
var dir, mwData;
|
||||
|
||||
// Initialization
|
||||
this.whitespace = [ '', '' ];
|
||||
|
||||
if ( this.selectedNode ) {
|
||||
this.input.setValueAndWhitespace( this.selectedNode.getAttribute( 'mw' ).body.extsrc );
|
||||
this.originalMwData = this.selectedNode.getAttribute( 'mw' );
|
||||
mwData = this.selectedNode.getAttribute( 'mw' );
|
||||
// mwData.body can be null in <selfclosing/> extensions
|
||||
this.input.setValueAndWhitespace( mwData.body && mwData.body.extsrc );
|
||||
this.originalMwData = mwData;
|
||||
} else {
|
||||
if ( !this.constructor.static.modelClasses[ 0 ].static.isContent ) {
|
||||
// New nodes should use linebreaks for blocks
|
||||
|
|
Loading…
Reference in a new issue