From 1d845aab1c05d2be1825f9f94f3e339c8daf2065 Mon Sep 17 00:00:00 2001 From: Thalia Date: Mon, 8 Oct 2018 13:34:35 +0100 Subject: [PATCH] Don't add body attribute to an extension node with an empty body Map nodes with an empty body don't have a body property on their 'mw' attribute; so don't add one when checking if the node has been modified. Bug: T206473 Change-Id: I24fb8d5f012c417996c8d420fa25af9d13528d18 --- modules/ve-mw/ui/ve.ui.MWExtensionWindow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw/ui/ve.ui.MWExtensionWindow.js b/modules/ve-mw/ui/ve.ui.MWExtensionWindow.js index 8ac5278cf8..0fa5d37289 100644 --- a/modules/ve-mw/ui/ve.ui.MWExtensionWindow.js +++ b/modules/ve-mw/ui/ve.ui.MWExtensionWindow.js @@ -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 */ @@ -254,7 +254,7 @@ ve.ui.MWExtensionWindow.prototype.updateMwData = function ( mwData ) { value = value.replace( new RegExp( '<(/' + tagName + '\\s*>)', 'gi' ), '<$1' ); if ( value.trim() === '' && this.constructor.static.selfCloseEmptyBody ) { - mwData.body = null; + delete mwData.body; } else { mwData.body = mwData.body || {}; mwData.body.extsrc = value;