-
-
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/main' into addSourceToChangesD…
…ialog * upstream/main: Fixed ADS tests Bump junit-jupiter from 5.9.1 to 5.9.2 (#9579) Bump actions/configure-pages from 2 to 3 open office csv format correction for abstract column (#9570) Update CHANGELOG.md add change log entry for the given change typo removed (#9577) remove filter that consumes mouse rightclick
- Loading branch information
Showing
10 changed files
with
68 additions
and
10 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
19 changes: 19 additions & 0 deletions
19
src/main/java/org/jabref/logic/layout/format/ReplaceWithEscapedDoubleQuotes.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,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(); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/main/resources/resource/layout/openoffice/openoffice-csv.layout
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 |
---|---|---|
@@ -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" |
38 changes: 38 additions & 0 deletions
38
...test/java/org/jabref/logic/formatter/bibtexfields/ReplaceWithEscapedDoubleQuotesTest.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,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")); | ||
} | ||
} |
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