Skip to content

Commit

Permalink
Fix koppor issues JabRef#3
Browse files Browse the repository at this point in the history
Fixed the issue "DOI: encoded URLs should be supported". New divider within the DOI % is supported.
  • Loading branch information
johannes-manner committed Feb 6, 2018
1 parent f3d86d5 commit 7920b92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/model/entry/identifier/DOI.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class DOI implements Identifier {
+ "(" // begin group \1
+ "10" // directory indicator
+ "(?:\\.[0-9]+)+" // registrant codes
+ "[/:]" // divider
+ "[/:%]" // divider
+ "(?:.+)" // suffix alphanumeric string
+ ")"; // end group \1
private static final String FIND_DOI_EXP = ""
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/org/jabref/model/entry/identifier/DOITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public void acceptURLDoi() {
Assert.assertEquals("10.1006/jmbi.1998.2354", new DOI("http://doi.org/10.1006/jmbi.1998.2354").getDOI());
// https
Assert.assertEquals("10.1006/jmbi.1998.2354", new DOI("https://doi.org/10.1006/jmbi.1998.2354").getDOI());
// https with % divider
Assert.assertEquals("10.2307/1990888", new DOI("https://dx.doi.org/10.2307%2F1990888").getDOI());
// other domains
Assert.assertEquals("10.1145/1294928.1294933", new DOI("http://doi.acm.org/10.1145/1294928.1294933").getDOI());
Assert.assertEquals("10.1145/1294928.1294933", new DOI("http://doi.acm.net/10.1145/1294928.1294933").getDOI());
Expand Down

0 comments on commit 7920b92

Please sign in to comment.