fix: downloadText() method to accommodate .md file format

This commit is contained in:
Adarsh Ashokan 2024-05-21 00:51:41 +05:30
parent a0e42aae9e
commit 7c7b5abad3

View File

@ -3831,7 +3831,8 @@ jQuery.PrivateBin = (function($, RawDeflate) {
*/
function downloadText()
{
var filename='paste-' + Model.getPasteId() + '.txt';
var fileFormat = PasteViewer.getFormat() === 'markdown' ? '.md' : '.txt';
var filename='paste-' + Model.getPasteId() + fileFormat;
var text = PasteViewer.getText();
var element = document.createElement('a');