Skip to content

#13301 Fix/unicode reference marks#13590

Merged
koppor merged 5 commits into
JabRef:mainfrom
AlexisFimeyer:fix/unicode-reference-marks
Jul 29, 2025
Merged

#13301 Fix/unicode reference marks#13590
koppor merged 5 commits into
JabRef:mainfrom
AlexisFimeyer:fix/unicode-reference-marks

Conversation

@AlexisFimeyer

@AlexisFimeyer AlexisFimeyer commented Jul 26, 2025

Copy link
Copy Markdown
Contributor

Uses Pattern.UNICODE_CHARACTER_CLASS so that \w also matches non-ASCII characters (e.g. Cyrillic, Chinese) in citation keys.
Adds unit tests with Cyrillic keys.

Closes #<13301>

Summary of changes

  • ReferenceMark.java
    Compiles both regex patterns with Pattern.UNICODE_CHARACTER_CLASS, allowing Unicode citation keys.
  • ReferenceMarkTest.java
    Adds two test cases (Ты2025, Я2025) to verify parsing of Cyrillic keys.
  • Manual verification in LibreOffice Writer confirms bibliography generation now works with non-Latin keys.

Steps to test

  1. Build & launch JabRef from this branch

  2. In JabRef, create a new library containing:

    @Article{Ты2025,
      author = {Ты},
      title  = {You},
      year   = {2025},
    }
    
    @Article{Я2025},
      author = {Я},
      title  = {I},
      year   = {2025},
    }
  3. Connect to an open LibreOffice Writer document via the OO/LO panel.

  4. Insert citations for both entries, then click Make/Sync bibliography.
    Expected: bibliography appears without error; Writer’s field names show in LibreOffice Writer.

  5. Run automated tests

    ./gradlew jablib:test --tests org.jabref.logic.openoffice.ReferenceMarkTest
Screen.Recording.2025-07-26.at.12.48.36.mov

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user “We fixed an issue where the LibreOffice integration did not support citation keys containing Unicode characters.”
  • Tests created for changes
  • Manually tested changed features in running JabRef
  • Screen Recording added in PR description.
  • Checked developer's documentation: N/A (no docs change needed)
  • Checked user documentation: opened issue / PR if docs need updating

   Uses Pattern.UNICODE_CHARACTER_CLASS so that \w also matches non-ASCII
   characters (e.g. Cyrillic, Chinese) in citation keys. Adds unit tests with
   Cyrillic keys.
Comment thread jablib/src/main/java/org/jabref/logic/openoffice/ReferenceMark.java Outdated
@AlexisFimeyer AlexisFimeyer changed the title Fix/unicode reference marks #13301 Fix/unicode reference marks Jul 26, 2025
@AlexisFimeyer AlexisFimeyer marked this pull request as draft July 26, 2025 11:15
@AlexisFimeyer AlexisFimeyer marked this pull request as ready for review July 26, 2025 12:26
@subhramit

Copy link
Copy Markdown
Member

Hi, thanks for your contribution.
We'll take a look at this soon.

@subhramit subhramit requested a review from InAnYan July 26, 2025 18:32
Comment thread CHANGELOG.md Outdated
@subhramit

Copy link
Copy Markdown
Member

Hi, the changes look fine, thanks for the video too!
I rarely get to say this, but good use of AI-assisted coding.

However, please fix the PR description as some of the information is hallucinated:

2. Install/upgrade the LibreOffice extension
JabRef → OO/LO panel → Install/Upgrade.

5. Writer’s field names (Ctrl+F9) show
JABREF_Ты2025 CID_1 … and JABREF_Я2025 CID_2 ….

And especially don't use AI when trying to mark the mandatory checks:

  • Manually tested changed features in running JabRef
  • Screenshots added in PR description (optional – a short GIF of Writer generating the bibliography could be added)

AlexisFimeyer and others added 2 commits July 27, 2025 10:39
Co-authored-by: Subhramit Basu <subhramit.bb@live.in>
@trag-bot

trag-bot Bot commented Jul 28, 2025

Copy link
Copy Markdown

@trag-bot didn't find any issues in the code! ✅✨

@koppor koppor requested a review from subhramit July 28, 2025 19:45
@koppor koppor added this pull request to the merge queue Jul 29, 2025
Merged via the queue into JabRef:main with commit 6acae66 Jul 29, 2025
1 check passed
Siedlerchr added a commit that referenced this pull request Aug 2, 2025
* 'main' of github.com:JabRef/jabref: (26 commits)
  Change Open AI to Open AI  (or API Compatible)  (#13608)
  Remove all assignment tracking labels
  Updated architecture and components link in CONTRIBUTING.md (#13606)
  #13301 Fix/unicode reference marks (#13590)
  Show fetch exception at citation relation (#13549)
  More jbang caching
  Sequential run for moving issues
  Update CSL Styles (#13601)
  Fix gradle issues (#13603)
  Add System.exit (#13510)
  New Crowdin updates (#13600)
  Automatic lookup DOI at citation information. (#13596)
  Update heylogs from 0.10.0 to 0.11.1 (#13594)
  add fallback and reenable defaultcomeslast (#13593)
  Fix debian vagrant image (#13589)
  Fix: Replace string "Tests" with "Source Code Tests" in PR Comment (#13587)
  Fix version for SNAPSHOT (#13581)
  Update JDK and JavaFX (#13580)
  Add icon (#13579)
  Fixes link I broke in PR 13568 (#13577)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LO/OO bibliography error when using citations with non-Latin charcters

3 participants