-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into fixattachfilerela…
…tive * upstream/master: Update dependencies (#4251) Fix author list parser (#4169) (#4248) Solved #3823 File annotation (#4246) Fix importer vulnerability (#4240)
- Loading branch information
Showing
14 changed files
with
124 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/test/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationViewModelTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.jabref.gui.entryeditor.fileannotationtab; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.Optional; | ||
|
||
import org.jabref.model.pdf.FileAnnotation; | ||
import org.jabref.model.pdf.FileAnnotationType; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class FileAnnotationViewModelTest { | ||
|
||
@Test | ||
public void removeOnlyLineBreaksNotPrecededByPeriodOrColon() { | ||
String content = "This is content"; | ||
String marking = String.format("This is paragraph 1.%n" + | ||
"This is paragr-%naph 2, and it crosses%nseveral lines,%nnow you can see next paragraph:%n" | ||
+ "This is paragraph%n3."); | ||
|
||
FileAnnotation linkedFileAnnotation = new FileAnnotation("John", LocalDateTime.now(), 3, content, FileAnnotationType.FREETEXT, Optional.empty()); | ||
FileAnnotation annotation = new FileAnnotation("Jaroslav Kucha ˇr", LocalDateTime.parse("2017-07-20T10:11:30"), 1, marking, FileAnnotationType.HIGHLIGHT, Optional.of(linkedFileAnnotation)); | ||
|
||
FileAnnotationViewModel annotationViewModel = new FileAnnotationViewModel(annotation); | ||
|
||
assertEquals("Jaroslav Kucha ˇr", annotationViewModel.getAuthor()); | ||
assertEquals(1, annotation.getPage()); | ||
assertEquals("2017-07-20 10:11:30", annotationViewModel.getDate()); | ||
assertEquals("This is content", annotationViewModel.getContent()); | ||
|
||
assertEquals(String.format("This is paragraph 1.%n" + | ||
"This is paragraph 2, and it crosses several lines, now you can see next paragraph:%n" | ||
+ "This is paragraph 3."), | ||
annotationViewModel.getMarking()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters