Skip to content

Commit

Permalink
Update citeproc to fix CSL render exceptions
Browse files Browse the repository at this point in the history
Fixes #8421
Fixes #8381
  • Loading branch information
Siedlerchr committed Feb 26, 2022
1 parent f17eb40 commit 5042075
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

### Changed

- We changed the list of CSL styles to those that support formatting bibliographies [#8421](https://github.com/JabRef/jabref/issues/8421) [citeproc-java#116](https://github.com/michel-kraemer/citeproc-java/issues/116)
- The CSL preview styles now also support displaying data from cross references entries that are linked via the `crossref` field [#7378](https://github.com/JabRef/jabref/issues/7378)
- We made the Search button in Web Search wider. We also skewed the panel titles to the left [#8397](https://github.com/JabRef/jabref/issues/8397)
- We introduced a preference to disable fulltext indexing [#8468](https://github.com/JabRef/jabref/issues/8468)

### Fixed

- We fixed an issue wehre long article numbers in the `pages` field would cause an exception and preventing the citation style to display [#8381](https://github.com/JabRef/jabref/issues/8381), [citeproc-java](https://github.com/michel-kraemer/citeproc-java/issues/114)
- We fixed an issue where an exception could occur when saving the preferences [#7614](https://github.com/JabRef/jabref/issues/7614)
- We fixed an issue where "Copy DOI url" in the right-click menu of the Entry List would just copy the DOI and not the DOI url. [#8389](https://github.com/JabRef/jabref/issues/8389)
- We fixed an issue where opening the console from the drop-down menu would cause an exception. [#8466](https://github.com/JabRef/jabref/issues/8466)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ dependencies {
implementation "org.tinylog:slf4j-tinylog:2.4.1"
implementation "org.tinylog:tinylog-impl:2.4.1"

implementation 'de.undercouch:citeproc-java:3.0.0-alpha.3'
implementation 'de.undercouch:citeproc-java:3.0.0-alpha.4'

// jakarta.activation is already depdency of glassfish
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '3.0.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import org.jabref.logic.util.StandardFileType;

import de.undercouch.citeproc.CSL;
import de.undercouch.citeproc.helper.CSLUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -154,6 +155,14 @@ private static List<CitationStyle> discoverCitationStylesInPath(Path path) throw
try (Stream<Path> stream = Files.find(path, 1, (file, attr) -> file.toString().endsWith("csl"))) {
return stream.map(Path::getFileName)
.map(Path::toString)
.filter(style -> {
try {
return CSL.canFormatBibliographies(style);
} catch (IOException e) {
LOGGER.warn("Cannot parse CSL style {}", style, e);
return false;
}
})
.map(CitationStyle::createCitationStyleFromFile)
.filter(Optional::isPresent)
.map(Optional::get)
Expand Down

0 comments on commit 5042075

Please sign in to comment.