Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/323858

Change subject: Handle missing pipes in Gallery syntax, and remove them when 
caption is empty
......................................................................

Handle missing pipes in Gallery syntax, and remove them when caption is empty

Bug: T146190
Change-Id: I703bcdf68b9631a47d839baf3abb42ff98b36bf2
---
M modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/58/323858/1

diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
index 94fea51..bf13fe8 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js
@@ -307,7 +307,7 @@
                                                                
imageTitles.push( titleText );
                                                                
dialog.initialImageData.push( {
                                                                        title: 
titleText,
-                                                                       
caption: matches[ 3 ]
+                                                                       
caption: matches[ 3 ] || ''
                                                                } );
                                                        }
                                                }
@@ -649,7 +649,7 @@
        // 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

-- 
To view, visit https://gerrit.wikimedia.org/r/323858
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I703bcdf68b9631a47d839baf3abb42ff98b36bf2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to