mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-12 09:09:25 +00:00
Handle missing pipes in Gallery syntax, and remove them when caption is empty
Bug: T146190 Change-Id: I703bcdf68b9631a47d839baf3abb42ff98b36bf2
This commit is contained in:
parent
f2c444c1bd
commit
240ec23113
|
@ -307,7 +307,7 @@ ve.ui.MWGalleryDialog.prototype.getSetupProcess = function ( data ) {
|
|||
imageTitles.push( titleText );
|
||||
dialog.initialImageData.push( {
|
||||
title: titleText,
|
||||
caption: matches[ 3 ]
|
||||
caption: matches[ 3 ] || ''
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
@ -649,7 +649,7 @@ ve.ui.MWGalleryDialog.prototype.updateMwData = function ( mwData ) {
|
|||
// Get titles and captions from gallery group
|
||||
this.highlightedItem.setCaption( this.highlightedCaptionInput.getValue() );
|
||||
for ( i = 0, ilen = items.length; i < ilen; i++ ) {
|
||||
extsrc += '\n' + items[ i ].imageTitle + '|' + items[ i ].caption;
|
||||
extsrc += '\n' + items[ i ].imageTitle + ( items[ i ].caption ? '|' + items[ i ].caption : '' );
|
||||
}
|
||||
|
||||
// Get data from options card
|
||||
|
|
Loading…
Reference in a new issue