diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 1b6c4b6e417..423b1454670 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -37,7 +37,7 @@ jobs: working-directory: docs/ - name: Setup Pages id: pages - uses: actions/configure-pages@v2 + uses: actions/configure-pages@v3 - name: Build with Jekyll run: | cd docs diff --git a/CHANGELOG.md b/CHANGELOG.md index f3ed7f3d631..11c66bd5388 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - For portable versions, the `.deb` file now works on plain debian again. [#9472](https://github.com/JabRef/jabref/issues/9472) - We fixed an issue where the download of linked online files failed after an import of entries for certain urls. [#9518](https://github.com/JabRef/jabref/issues/9518) - We fixed an issue where an exception occured when manually downloading a file from an URL in the entry editor. [#9521](https://github.com/JabRef/jabref/issues/9521) +- We fixed an issue with open office csv file formatting where commas in the abstract field where not escaped. [#9087][https://github.com/JabRef/jabref/issues/9087] +- We fixed an issue with deleting groups where subgroups different from the selected group were deleted. [#9281][https://github.com/JabRef/jabref/issues/9281] ## [5.8] - 2022-12-18 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6da1b9bab8a..0a9eb0afe0d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ General overview about contributing for programmers and non-programmers is avail ## Pull Request Process 1. Understand the basics listed at . -2. Follow the "formal requirements". They are not too hard, they merely support the maintainers to focus on supportive feedback than just stating the obvious. The also have helpful hints how to work with localization. +2. Follow the "formal requirements". They are not too hard, they merely support the maintainers to focus on supportive feedback than just stating the obvious. They also have helpful hints how to work with localization. 3. Create a pull request. You can create a draft pull request to enable automatic checks. 4. Wait for feedback of the developers 5. Address the feedback of the developers diff --git a/build.gradle b/build.gradle index a7c787fe309..2289d2b5249 100644 --- a/build.gradle +++ b/build.gradle @@ -204,7 +204,7 @@ dependencies { implementation group: 'net.harawata', name: 'appdirs', version: '1.2.1' testImplementation 'io.github.classgraph:classgraph:4.8.154' - testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1' + testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2' testImplementation 'org.junit.platform:junit-platform-launcher:1.9.2' testImplementation 'org.mockito:mockito-core:5.0.0' diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 27225aa42ac..eac9957ff29 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -28,7 +28,6 @@ import javafx.scene.control.TreeTableView; import javafx.scene.input.ClipboardContent; import javafx.scene.input.Dragboard; -import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; import javafx.scene.input.TransferMode; import javafx.scene.layout.BorderPane; @@ -266,10 +265,7 @@ private void initialize() { .mapOpt(this::createContextMenuForGroup) .orElseOpt((ContextMenu) null)); row.addEventFilter(MouseEvent.MOUSE_PRESSED, event -> { - if (event.getButton() == MouseButton.SECONDARY) { - // Prevent right-click to select group - event.consume(); - } else if (event.getTarget() instanceof StackPane pane) { + if (event.getTarget() instanceof StackPane pane) { if (pane.getStyleClass().contains("arrow") || pane.getStyleClass().contains("tree-disclosure-node")) { event.consume(); } diff --git a/src/main/java/org/jabref/logic/layout/LayoutEntry.java b/src/main/java/org/jabref/logic/layout/LayoutEntry.java index 2043953c218..495795417a5 100644 --- a/src/main/java/org/jabref/logic/layout/LayoutEntry.java +++ b/src/main/java/org/jabref/logic/layout/LayoutEntry.java @@ -72,6 +72,7 @@ import org.jabref.logic.layout.format.RemoveTilde; import org.jabref.logic.layout.format.RemoveWhitespace; import org.jabref.logic.layout.format.Replace; +import org.jabref.logic.layout.format.ReplaceWithEscapedDoubleQuotes; import org.jabref.logic.layout.format.RisAuthors; import org.jabref.logic.layout.format.RisKeywords; import org.jabref.logic.layout.format.RisMonth; @@ -475,6 +476,7 @@ private LayoutFormatter getLayoutFormatterByName(String name) { case "Markdown" -> new MarkdownFormatter(); case "CSLType" -> new CSLType(); case "ShortMonth" -> new ShortMonthFormatter(); + case "ReplaceWithEscapedDoubleQuotes" -> new ReplaceWithEscapedDoubleQuotes(); default -> null; }; } diff --git a/src/main/java/org/jabref/logic/layout/format/ReplaceWithEscapedDoubleQuotes.java b/src/main/java/org/jabref/logic/layout/format/ReplaceWithEscapedDoubleQuotes.java new file mode 100644 index 00000000000..059d9b0337c --- /dev/null +++ b/src/main/java/org/jabref/logic/layout/format/ReplaceWithEscapedDoubleQuotes.java @@ -0,0 +1,19 @@ +package org.jabref.logic.layout.format; + +import org.jabref.logic.layout.LayoutFormatter; + +public class ReplaceWithEscapedDoubleQuotes implements LayoutFormatter { + @Override + public String format(String fieldText) { + StringBuilder builder = new StringBuilder(fieldText.length()); + + for (char c : fieldText.toCharArray()) { + if (c == '\"') { + builder.append("\"\""); + } else { + builder.append(c); + } + } + return builder.toString(); + } +} diff --git a/src/main/resources/resource/layout/openoffice/openoffice-csv.layout b/src/main/resources/resource/layout/openoffice/openoffice-csv.layout index 42f6e906329..d76ad31d0c9 100644 --- a/src/main/resources/resource/layout/openoffice/openoffice-csv.layout +++ b/src/main/resources/resource/layout/openoffice/openoffice-csv.layout @@ -1 +1 @@ -\format[GetOpenOfficeType]{\entrytype},"\begin{isbn}\isbn\end{isbn}","\citationkey","\format[Authors(LastFirst,FullName,Semicolon,Semicolon)]{\author}","\format[RemoveBrackets,RemoveWhitespace]{\title}","\journal",\volume,\number,"\month","\pages",\year,"\address","\note","\url","\booktitle","\chapter","\edition","\series","\format[Authors(LastFirst,FullName,Semicolon,Semicolon)]{\editor}","\publisher","\begin{reporttype}\reporttype\end{reporttype}","\howpublished","\institution","\organization","\school","\annote","\format[Replace(\n, )]{\abstract}","\comment","\keywords","\format[FileLink(pdf)]{\file}","\key" +\format[GetOpenOfficeType]{\entrytype},"\begin{isbn}\isbn\end{isbn}","\citationkey","\format[Authors(LastFirst,FullName,Semicolon,Semicolon)]{\author}","\format[RemoveBrackets,RemoveWhitespace]{\title}","\journal",\volume,\number,"\month","\pages",\year,"\address","\note","\url","\booktitle","\chapter","\edition","\series","\format[Authors(LastFirst,FullName,Semicolon,Semicolon)]{\editor}","\publisher","\begin{reporttype}\reporttype\end{reporttype}","\howpublished","\institution","\organization","\school","\annote","\format[Replace(\n, ),ReplaceWithEscapedDoubleQuotes]{\abstract}","\comment","\keywords","\format[FileLink(pdf)]{\file}","\key" diff --git a/src/test/java/org/jabref/logic/formatter/bibtexfields/ReplaceWithEscapedDoubleQuotesTest.java b/src/test/java/org/jabref/logic/formatter/bibtexfields/ReplaceWithEscapedDoubleQuotesTest.java new file mode 100644 index 00000000000..ed1f6bcf5bd --- /dev/null +++ b/src/test/java/org/jabref/logic/formatter/bibtexfields/ReplaceWithEscapedDoubleQuotesTest.java @@ -0,0 +1,38 @@ +package org.jabref.logic.formatter.bibtexfields; + +import org.jabref.logic.layout.format.ReplaceWithEscapedDoubleQuotes; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class ReplaceWithEscapedDoubleQuotesTest { + + private ReplaceWithEscapedDoubleQuotes formatter; + + @BeforeEach + public void setUp() { + formatter = new ReplaceWithEscapedDoubleQuotes(); + } + + @Test + public void replacingSingleDoubleQuote() { + assertEquals("single \"\"double quote", formatter.format("single \"double quote")); + } + + @Test + public void replacingMultipleDoubleQuote() { + assertEquals("multiple \"\"double\"\" quote", formatter.format("multiple \"double\" quote")); + } + + @Test + public void replacingSingleDoubleQuoteHavingCommas() { + assertEquals("this \"\"is\"\", a test", formatter.format("this \"is\", a test")); + } + + @Test + public void doNothing() { + assertEquals("this is a test", formatter.format("this is a test")); + } +} diff --git a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java index 219ce711326..aca29ba0c7f 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java @@ -49,6 +49,7 @@ public void setUp() throws Exception { .withField(StandardField.TITLE, "Slice theorem and orbit type stratification in infinite dimensions") .withField(StandardField.YEAR, "2018") .withField(StandardField.ARCHIVEPREFIX, "arXiv") + .withField(StandardField.DOI, "10.48550/arXiv.1812.04698") .withField(StandardField.EPRINT, "1812.04698") .withField(StandardField.JOURNAL, "arXiv e-prints") .withField(StandardField.KEYWORDS, "Mathematics - Differential Geometry, Mathematical Physics, 58B25, (58D19, 58B20, 22E99, 58A35)") @@ -70,7 +71,7 @@ public void setUp() throws Exception { .withField(StandardField.MONTH, "#sep#") .withField(StandardField.NUMBER, "1") .withField(StandardField.ARCHIVEPREFIX, "arXiv") - .withField(StandardField.DOI, "10.12942/lrr-2012-10") + .withField(StandardField.DOI, "10.12942/lrr-2012-1010.48550/arXiv.1112.3960") .withField(StandardField.PRIMARYCLASS, "astro-ph.CO") .withField(StandardField.EID, "10") .withField(StandardField.EPRINT, "1112.3960")