Skip to content

Commit e7131d5

Browse files
committed
downloads in "full-json" produce filename with .json extension
1 parent 612ce62 commit e7131d5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/snapshot/download.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function downloadImage(gd, opts) {
5151
var promise = toImage(gd, opts);
5252

5353
var filename = opts.filename || gd.fn || 'newplot';
54-
filename += '.' + opts.format;
54+
filename += '.' + opts.format.replace('-', '.');
5555

5656
promise.then(function(result) {
5757
if(_gd) _gd._snapshotInProgress = false;

test/jasmine/tests/download_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function downloadTest(gd, format) {
209209
var linkdeleted = domchanges[domchanges.length - 1].removedNodes[0];
210210

211211
expect(linkadded.getAttribute('href').split(':')[0]).toBe('blob');
212-
expect(filename).toBe('plotly_download.' + format);
212+
expect(filename).toBe('plotly_download.' + format.replace('-', '.'));
213213
expect(linkadded).toBe(linkdeleted);
214214
});
215215
}

0 commit comments

Comments
 (0)