Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSL - Fix bug when inserting reference coalescing before first entry #11723

Merged
merged 2 commits into from
Sep 7, 2024

Conversation

subhramit
Copy link
Member

@subhramit subhramit commented Sep 7, 2024

Follow-up to: #11712
Fixes the following edge-case bugs:

  1. Inserting a new reference just before the reference numbered "1" without any space or line break or text in between (coalescing case 1)
bug1.mp4
  1. Inserting a new reference before the reference numbered "1" with a paragraph break [shift+enter] (not a line break [enter]) (coalescing case 2)
bug2.mp4

Both cases used to throw an exception and did not update the old "1" after the new reference to "2".

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@subhramit subhramit marked this pull request as draft September 7, 2024 18:11
@subhramit subhramit marked this pull request as ready for review September 7, 2024 18:13
@subhramit subhramit added this pull request to the merge queue Sep 7, 2024
@subhramit
Copy link
Member Author

subhramit commented Sep 7, 2024

Just came to my notice that the bibliography does not update with the new entry (coalesced before the old entry).

This is unrelated, and is because of the bleed-out of the old reference mark (the new one becomes a part of the old 1's reference mark as well). This is due to no proper manual space/break, and the fact that if we open a fresh document and insert a reference, smart spaces are not inserted as well (as there is literally no text in the document - hence practically unlikely to occur for a CSL user. It is also unlikely that they will try placing a citation before the first citation without any text or break, and this happens only in the case of the first citation).

Hence, we can let this PR in, as it at least avoids the exception.

Merged via the queue into JabRef:main with commit fbe1e15 Sep 7, 2024
23 checks passed
@subhramit subhramit deleted the csl-bugfix branch September 7, 2024 18:25
leaf-soba pushed a commit to leaf-soba/jabref that referenced this pull request Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants