| 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 | } |