Ticket #1193: BibTeX.js.diff

File BibTeX.js.diff, 1.1 KB (added by karnesky, 8 years ago)
  • BibTeX.js

     
    17861786        value = value + ""; // convert integers to strings 
    17871787        Zotero.write(",\n\t"+field+" = "); 
    17881788        if(!isMacro) Zotero.write("{"); 
    1789         // I hope these are all the escape characters! 
    1790         value = value.replace(/[|\<\>\~\^\\]/g, mapEscape).replace(/([\#\$\%\&\_])/g, "\\$1"); 
    1791         // Case of words with uppercase characters in non-initial positions is preserved with braces. 
    1792         if(!isMacro) value = value.replace(/([^\s]+[A-Z][^\s]*)/g, "{$1}"); 
     1789        // url field is preserved, for use with \href and \url 
     1790        // Other fields (DOI?) may need similar treatment 
     1791        if(field != "url") { 
     1792                // I hope these are all the escape characters! 
     1793                value = value.replace(/[|\<\>\~\^\\]/g, mapEscape).replace(/([\#\$\%\&\_])/g, "\\$1"); 
     1794                // Case of words with uppercase characters in non-initial positions is preserved with braces. 
     1795                if(!isMacro) value = value.replace(/([^\s]+[A-Z][^\s]*)/g, "{$1}"); 
     1796        } 
    17931797        if (!Zotero.getOption("UTF8")) { 
    17941798                value = value.replace(/[\u0080-\uFFFF]/g, mapAccent); 
    17951799        }