Skip to content

Commit e62842d

Browse files
authored
Merge branch 'JabRef:main' into fix-for-issue-12296
2 parents dbc25a0 + f2ac9f0 commit e62842d

File tree

8 files changed

+54
-6
lines changed

8 files changed

+54
-6
lines changed

.github/workflows/on-issue-comment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: takanome-dev/assign-issue-action@edge
1717
with:
1818
github_token: '${{ secrets.GITHUB_TOKEN }}'
19-
days_until_unassign: 45
19+
days_until_unassign: 14
2020
maintainers: 'koppor,Siedlerchr,ThiloteE,calixtus,HoussemNasri,subhramit,LinusDietz'
2121
assigned_comment: |
2222
👋 Hey @{{ handle }}, thank you for your interest in this issue! 🎉
@@ -29,7 +29,7 @@ jobs:
2929
3030
Happy coding! 🚀
3131
32-
⏳ Please note, you will be automatically unassigned if the issue isn't closed within **{{ total_days }} days** (by **{{ unassigned_date }}**). A maintainer can also add the "**{{ pin_label }}**" label to prevent automatic unassignment.
32+
⏳ Please note, you will be automatically unassigned if there is not a (draft) pull request within **{{ total_days }} days** (by **{{ unassigned_date }}**).
3333
assignment_suggestion_comment: >
3434
👋 Hey @{{ handle }}, looks like you’re eager to work on this issue—great! 🎉
3535
It also looks like you skipped reading our [CONTRIBUTING.md](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md), which explains exactly how to participate. No worries, it happens to the best of us.

.github/workflows/on-pr-closed.yml

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ jobs:
5656
run: gh issue edit ${{ steps.get_issue_number.outputs.ticketNumber }} --remove-label "📍 Assigned"
5757
env:
5858
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
- name: Remove pinned label
60+
run: gh issue edit ${{ steps.get_issue_number.outputs.ticketNumber }} --remove-label "📌 Pinned"
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5963
- name: Remove FirstTimeCodeContribution label
6064
run: gh issue edit ${{ steps.get_issue_number.outputs.ticketNumber }} --remove-label "FirstTimeCodeContribution"
6165
env:

.github/workflows/on-pr-opened.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ jobs:
4949
with:
5050
show-progress: 'false'
5151
- name: Assign PR creator to issue
52-
run: gh issue edit ${{ steps.get_issue_number.outputs.ticketNumber }} --add-assignee ${{ github.event.pull_request.user.login }}
52+
# "gh issue edit" cannot be used - workaround found at https://github.com/cli/cli/issues/9620#issuecomment-2703135049
53+
run: gh api -X PATCH /repos/JabRef/jabref/issues/${{ steps.get_issue_number.outputs.ticketNumber }} -f assignee=${{ github.event.pull_request.user.login }}
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Add label "📌 Pinned"
57+
run: gh issue edit ${{ steps.get_issue_number.outputs.ticketNumber }} --add-label "📌 Pinned"
5358
env:
5459
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5560
conflicts_with_target:

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ jobs:
392392
393393
unmodified_submodules:
394394
name: Submodules not modified
395-
if: github.actor != 'dependabot[bot]'
395+
if: github.actor != 'dependabot[bot]' && github.event_name == 'pull_request'
396396
runs-on: ubuntu-latest
397397
steps:
398398
- uses: actions/checkout@v4

.github/workflows/unassign-issues.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: takanome-dev/assign-issue-action@edge
2020
with:
2121
github_token: '${{ secrets.GITHUB_TOKEN }}'
22-
days_until_unassign: 45
22+
days_until_unassign: 14
2323
move_unassigned_issues:
2424
needs: unassign_issues
2525
if: ${{ needs.unassign_issues.outputs.unassigned_issues != '[]' }}

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
2222
- We added an integrity check if a URL appears in a title. [#12354](https://github.com/JabRef/jabref/issues/12354)
2323
- We added a feature for enabling drag-and-drop of files into groups [#12540](https://github.com/JabRef/jabref/issues/12540)
2424
- We added support for reordering keywords via drag and drop, automatic alphabetical ordering, and improved pasting and editing functionalities in the keyword editor. [#10984](https://github.com/JabRef/jabref/issues/10984)
25+
- We added a new functionality where author names having multiple spaces in-between will be considered as separate user block as it does for " and ". [#12701](https://github.com/JabRef/jabref/issues/12701)
2526

2627
### Changed
2728

src/main/java/org/jabref/logic/importer/AuthorListParser.java

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public class AuthorListParser {
3939

4040
private static final Pattern STARTS_WITH_CAPITAL_LETTER_DOT_OR_DASH = Pattern.compile("^[A-Z](\\.[ -]| ?-)");
4141

42+
private static final Pattern MULTIPLE_SPACE_PATTERN = Pattern.compile("\\s{2,}");
43+
44+
private static final Pattern NEW_LINE_PATTERN = Pattern.compile("\\s*\\n\\s*");
45+
4246
/**
4347
* the raw bibtex author/editor field
4448
*/
@@ -100,6 +104,10 @@ private record SimpleNormalFormResult(String authors, boolean andOthersPresent)
100104

101105
private static SimpleNormalFormResult getSimpleNormalForm(String listOfNames) {
102106
listOfNames = listOfNames.replace(" -", "-").trim();
107+
if (!listOfNames.contains(",") && (MULTIPLE_SPACE_PATTERN.matcher(listOfNames).find() || listOfNames.contains("\n"))) {
108+
listOfNames = NEW_LINE_PATTERN.matcher(listOfNames).replaceAll(" and ");
109+
listOfNames = MULTIPLE_SPACE_PATTERN.matcher(listOfNames).replaceAll(" and ");
110+
}
103111

104112
// Handling of "and others"
105113
// Remove it from the list; it will be added at the very end of this method as special Author.OTHERS

src/test/java/org/jabref/logic/importer/AuthorListParserTest.java

+31-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,37 @@ private static Stream<Arguments> parseMultipleCorrectly() {
7979
new Author("Thomas", "T.", null, "Lai", null)
8080
),
8181
"U, Vivian and Lai, Thomas"
82-
)
82+
),
83+
Arguments.of(
84+
AuthorList.of(
85+
new Author("I.", "I.", null, "Podadera", null),
86+
new Author("J. M.", "J. M.", null, "Carmona", null),
87+
new Author("A.", "A.", null, "Ibarra", null),
88+
new Author("J.", "J.", null, "Molla", null)
89+
),
90+
"I. Podadera J. M. Carmona A. Ibarra J. Molla"),
91+
Arguments.of(
92+
AuthorList.of(
93+
new Author("Alexander", "A.", null, "Artemenko", null),
94+
new Author("I.", "I.", null, "Podadera", null),
95+
new Author("J. M.", "J. M.", null, "Carmona", null)
96+
),
97+
"""
98+
Alexander Artemenko
99+
I. Podadera
100+
J. M. Carmona
101+
"""),
102+
Arguments.of(
103+
AuthorList.of(
104+
new Author("First1", "F.", null, "Last1", null),
105+
new Author("First2", "F.", null, "Last2", null),
106+
new Author("First3", "F.", null, "Last3", null)
107+
),
108+
"""
109+
First1 Last1
110+
First2 Last2
111+
First3 Last3
112+
""")
83113
);
84114
}
85115

0 commit comments

Comments
 (0)