Jforrester has uploaded a new change for review.

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

Change subject: DSVFileTransferHandler: Skip empty lines in input files
......................................................................

DSVFileTransferHandler: Skip empty lines in input files

Change-Id: I1fbc1be458b1b0b2bfaa8a7ea41ff6c1bf714e41
---
M src/ui/datatransferhandlers/ve.ui.DSVFileTransferHandler.js
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/39/280839/1

diff --git a/src/ui/datatransferhandlers/ve.ui.DSVFileTransferHandler.js 
b/src/ui/datatransferhandlers/ve.ui.DSVFileTransferHandler.js
index 8d44229..2c07c07 100644
--- a/src/ui/datatransferhandlers/ve.ui.DSVFileTransferHandler.js
+++ b/src/ui/datatransferhandlers/ve.ui.DSVFileTransferHandler.js
@@ -50,8 +50,15 @@
                );
 
                for ( i = 0; i < input.data.length; i++ ) {
-                       data.push( { type: 'tableRow' } );
                        line = input.data[ i ];
+
+                       // Skip 'empty' rows, generally at the end of the file
+                       if ( line.length === 1 && line[ 0 ] === '' )
+                       {
+                                continue;
+                       }
+
+                       data.push( { type: 'tableRow' } );
                        for ( j = 0; j < line.length; j++ ) {
                                data.push(
                                        { type: 'tableCell', attributes: { 
style: ( i === 0 ? 'header' : 'data' ) } },

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1fbc1be458b1b0b2bfaa8a7ea41ff6c1bf714e41
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>

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

Reply via email to