Sfoglia il codice sorgente

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

Adarsh Ashokan 2 anni fa
parent
commit
7c7b5abad3
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      js/privatebin.js

+ 2 - 1
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');