diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b6e9aa67f6..cd32fdd16bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We added the option to copy the DOI of an entry directly from the context menu copy submenu. [#7826](https://github.com/JabRef/jabref/issues/7826) - We added a fulltext search feature. [#2838](https://github.com/JabRef/jabref/pull/2838) +- We added unprotect_terms to the list of bracketed pattern modifiers [#7826](https://github.com/JabRef/jabref/pull/7960) ### Changed diff --git a/src/main/java/org/jabref/logic/formatter/Formatters.java b/src/main/java/org/jabref/logic/formatter/Formatters.java index a97c3a85235..0eddde42194 100644 --- a/src/main/java/org/jabref/logic/formatter/Formatters.java +++ b/src/main/java/org/jabref/logic/formatter/Formatters.java @@ -29,6 +29,7 @@ import org.jabref.logic.formatter.casechanger.LowerCaseFormatter; import org.jabref.logic.formatter.casechanger.SentenceCaseFormatter; import org.jabref.logic.formatter.casechanger.TitleCaseFormatter; +import org.jabref.logic.formatter.casechanger.UnprotectTermsFormatter; import org.jabref.logic.formatter.casechanger.UpperCaseFormatter; import org.jabref.logic.formatter.minifier.MinifyNameListFormatter; import org.jabref.logic.formatter.minifier.TruncateFormatter; @@ -74,7 +75,8 @@ public static List getOthers() { new UnitsToLatexFormatter(), new EscapeUnderscoresFormatter(), new EscapeAmpersandsFormatter(), - new ShortenDOIFormatter() + new ShortenDOIFormatter(), + new UnprotectTermsFormatter() ); } diff --git a/src/test/java/org/jabref/logic/citationkeypattern/BracketedPatternTest.java b/src/test/java/org/jabref/logic/citationkeypattern/BracketedPatternTest.java index de02294c736..5d84f2c45a1 100644 --- a/src/test/java/org/jabref/logic/citationkeypattern/BracketedPatternTest.java +++ b/src/test/java/org/jabref/logic/citationkeypattern/BracketedPatternTest.java @@ -386,6 +386,13 @@ void expandBracketsWithTestCasesFromRegExpBasedFileFinder() { BracketedPattern.expandBrackets("[author] have published [title] in [journal].", ',', entry, database)); } + @Test + void expandBracketsWithoutProtectiveBracesUsingUnprotectTermsModifier() { + BibEntry bibEntry = new BibEntry() + .withField(StandardField.JOURNAL, "{ACS} Medicinal Chemistry Letters"); + assertEquals("ACS Medicinal Chemistry Letters", BracketedPattern.expandBrackets("[JOURNAL:unprotect_terms]", null, bibEntry, null)); + } + @ParameterizedTest @MethodSource("provideArgumentsForFallback") void expandBracketsWithFallback(String expandResult, String pattern) {