Skip to content

Commit

Permalink
Abbreviation toggle within the JournalEditorViewModel now ignores cur…
Browse files Browse the repository at this point in the history
…ly braces (issue #7773) (#7807)

* We changed the abbreviation toggle within the JournalEditorViewModel.java to ignore curly braces when matching (Issue #7773).

* Change .replace() to StringUtil.ignoreCurlyBracket()

* Update CHANGELOG.md

Co-authored-by: Christoph <[email protected]>
  • Loading branch information
brapana and Siedlerchr authored Jun 17, 2021
1 parent 2f0c683 commit 38d7a30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- The tooltip of the search field explaining the search is always shown. [#7279](https://github.com/JabRef/jabref/pull/7279)
- We rewrote the ACM fetcher to adapt to the new interface. [#5804](https://github.com/JabRef/jabref/issues/5804)
- We moved the select/collapse buttons in the unlinked files dialog into a context menu. [#7383](https://github.com/JabRef/jabref/issues/7383)
- We fixed an issue where journal abbreviations containing curly braces were not recognized [#7773](https://github.com/JabRef/jabref/issues/7773)

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ public void toggleAbbreviation() {
return;
}

if (journalAbbreviationRepository.isKnownName(text.get())) {
Optional<String> nextAbbreviation = journalAbbreviationRepository.getNextAbbreviation(text.get());
// Ignore brackets when matching abbreviations.
final String name = StringUtil.ignoreCurlyBracket(text.get());

if (journalAbbreviationRepository.isKnownName(name)) {
Optional<String> nextAbbreviation = journalAbbreviationRepository.getNextAbbreviation(name);

if (nextAbbreviation.isPresent()) {
text.set(nextAbbreviation.get());
Expand Down

0 comments on commit 38d7a30

Please sign in to comment.