Skip to content

Commit

Permalink
Fix IEEE preview does not display month (JabRef#3239)
Browse files Browse the repository at this point in the history
  • Loading branch information
DevSiroukane committed Apr 26, 2018
1 parent 6738711 commit 4d7525e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ private static CSLItemData bibEntryToCSLItemData(BibEntry bibEntry) {

// create a copy of bibEntry
bibEntry = (BibEntry) bibEntry.clone();
// change month field from "#mon#" to "mon"
if((bibEntry.getFieldMap().get(FieldName.MONTH) != null) && !bibEntry.getFieldMap().get(FieldName.MONTH).isEmpty()){
bibEntry.getFieldMap().put(FieldName.MONTH, bibEntry.getMonth().get().getShortName());
}

String citeKey = bibEntry.getCiteKeyOptional().orElse("");
BibTeXEntry bibTeXEntry = new BibTeXEntry(new Key(bibEntry.getType()), new Key(citeKey));
Expand All @@ -100,6 +96,11 @@ private static CSLItemData bibEntryToCSLItemData(BibEntry bibEntry) {
HTMLChars latexToHtmlConverter = new HTMLChars();
RemoveNewlinesFormatter removeNewlinesFormatter = new RemoveNewlinesFormatter();
for (String key : bibEntry.getFieldMap().keySet()) {
if (FieldName.MONTH.equals(key)) {
// change month field value from "#mon#" to "mon"
bibEntry.getFieldMap().put(FieldName.MONTH, bibEntry.getMonth().get().getShortName());
}

bibEntry.getField(key)
.map(removeNewlinesFormatter::format)
.map(latexToHtmlConverter::format)
Expand Down

0 comments on commit 4d7525e

Please sign in to comment.