Skip to content

Commit

Permalink
Fix Bib(La)TeX export for attachments with no titles
Browse files Browse the repository at this point in the history
  • Loading branch information
aurimasv committed Jul 2, 2015
1 parent 678f011 commit 6aabcf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion BibLaTeX.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exportFileData": false,
"useJournalAbbreviation": false
},
"lastUpdated": "2014-08-25 06:43:15"
"lastUpdated": "2015-07-02 02:03:17"
}


Expand Down Expand Up @@ -438,6 +438,7 @@ var filePathSpecialChars = '\\\\:;{}$'; // $ for Mendeley
var encodeFilePathRE = new RegExp('[' + filePathSpecialChars + ']', 'g');

function encodeFilePathComponent(value) {
if (!value) return '';
return value.replace(encodeFilePathRE, "\\$&");
}

Expand Down
5 changes: 4 additions & 1 deletion BibTeX.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"inRepository": true,
"translatorType": 3,
"browserSupport": "gcsv",
"lastUpdated": "2015-05-20 22:03:17"
"lastUpdated": "2015-07-02 02:03:17"
}

function detectImport() {
Expand Down Expand Up @@ -1014,14 +1014,17 @@ var encodeFilePathRE = new RegExp('[' + filePathSpecialChars + ']', 'g');

// We strip out {} in general, because \{ and \} still break BibTeX (0.99d)
function cleanFilePath(str) {
if (!str) return '';
return str.replace(/(?:\s*[{}]+)+\s*/g, ' ');
}

function encodeFilePathComponent(value) {
if (!value) return '';
return value.replace(encodeFilePathRE, "\\$&");
}

function decodeFilePathComponent(value) {
if (!value) return '';
return value.replace(/\\([^A-Za-z0-9.])/g, "$1");
}

Expand Down

0 comments on commit 6aabcf5

Please sign in to comment.