Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/bibtex_js.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ function BibtexParser() {
end = this.pos + 1;
if (this.tryMatch("}")) {
this.match("}");
} else {
} else if (this.tryMatch(")")) {
this.match(")");
}
if (this.tryMatch(",")) {
Expand Down Expand Up @@ -312,7 +312,8 @@ function BibtexDisplay() {
this.regExps.push(new RegExp("\\\\\\W*\{\\w+\}")); // 2 \[]{\[]}
this.regExps.push(new RegExp("\\\\\\W*\\w+\\s")); // 3 \[]
this.regExps.push(new RegExp("\\\\\\W*\\w+")); // 4 \[]
this.regExps.push(new RegExp("\\\\(?![:\\\\\])\\W{1}")); // 5
this.regExps.push(new RegExp("\\\\\\w\{\\w\}")); // 5 \\\w{\w} to match e.g. \v{r}
this.regExps.push(new RegExp("\\\\(?![:\\\\\])\\W{1}")); // 6

this.fixValue = function(value) {
do {
Expand Down Expand Up @@ -347,6 +348,7 @@ function BibtexDisplay() {
}
}
value = value.replace(/[\{|\}]/g, '');
value = value.replace(/\$(.*?)\$/, '$1'); // remove $..$ used for math env.
return value;
}

Expand Down Expand Up @@ -3568,4 +3570,4 @@ var latex_to_unicode = {
"{\\o}": "\u00D8",
"{\AA}": "\u212B",
"\\relax ": ""
};
};