Merge "Don't add body attribute to an extension node with an empty body"

This commit is contained in:
jenkins-bot 2018-10-08 23:16:16 +00:00 committed by Gerrit Code Review
commit 1afd5651ab

View file

@ -240,7 +240,7 @@ ve.ui.MWExtensionWindow.prototype.removeNode = function () {
}; };
/** /**
* Update mwData object with the new values from the inspector * Update mwData object with the new values from the inspector or dialog
* *
* @param {Object} mwData MediaWiki data object * @param {Object} mwData MediaWiki data object
*/ */
@ -254,7 +254,7 @@ ve.ui.MWExtensionWindow.prototype.updateMwData = function ( mwData ) {
value = value.replace( new RegExp( '<(/' + tagName + '\\s*>)', 'gi' ), '&lt;$1' ); value = value.replace( new RegExp( '<(/' + tagName + '\\s*>)', 'gi' ), '&lt;$1' );
if ( value.trim() === '' && this.constructor.static.selfCloseEmptyBody ) { if ( value.trim() === '' && this.constructor.static.selfCloseEmptyBody ) {
mwData.body = null; delete mwData.body;
} else { } else {
mwData.body = mwData.body || {}; mwData.body = mwData.body || {};
mwData.body.extsrc = value; mwData.body.extsrc = value;