From 7c7b5abad3280d8f6b2f921bfacf7322931b3b96 Mon Sep 17 00:00:00 2001 From: Adarsh Ashokan Date: Tue, 21 May 2024 00:51:41 +0530 Subject: [PATCH] fix: downloadText() method to accommodate .md file format --- js/privatebin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/privatebin.js b/js/privatebin.js index 65b97169..33a4494e 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -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');