Skip to content

Commit

Permalink
Style and comment tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Aug 5, 2024
1 parent c7b216e commit 14f5096
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/tests/utilitiesTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe("Zotero.Utilities", function() {
assert.equal(cleanDOI(`Foo bar ${encodedUri}. Foo bar`), expected);
});

it("should parse a DOI with url encoded params", function () {
it("should parse a DOI URL with encoded characters", function () {
const encodedUri = "https://doi.org/10.1002/1096-9128(200005)12:6%3C375::AID-CPE480%3E3.0.CO;2-M";
const expected = "10.1002/1096-9128(200005)12:6<375::AID-CPE480>3.0.CO;2-M";
assert.equal(cleanDOI(`Foo bar ${encodedUri}. Foo bar`), expected);
Expand Down
6 changes: 3 additions & 3 deletions utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,11 @@ var Utilities = {
var result = doi[0];

// Check if the DOI ends with a bracket
const trailingBracket = result.slice(-1);
var trailingBracket = result.slice(-1);
if ([']', ')', '}'].includes(trailingBracket)) {
// Check the portion of the string before the matched DOI for an unclosed bracket
const beforeDOI = x.slice(0, doi.index);
const openingBracket = {
let beforeDOI = x.slice(0, doi.index);
let openingBracket = {
']': '[',
')': '(',
'}': '{'
Expand Down

0 comments on commit 14f5096

Please sign in to comment.