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

Hex encoded character breakes entry #8303

Closed
2 tasks done
kristofmeixner opened this issue Dec 6, 2021 · 4 comments · Fixed by #8382
Closed
2 tasks done

Hex encoded character breakes entry #8303

kristofmeixner opened this issue Dec 6, 2021 · 4 comments · Fixed by #8382
Labels
bug Confirmed bugs or reports that are very likely to be bugs entry-editor export / save

Comments

@kristofmeixner
Copy link
Contributor

JabRef version

5.3 (latest release)

Operating system

GNU / Linux

Details on version and operating system

No response

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Open bug-1.bib
  2. Change something, e.g., generate a new Bibtex key and save the library
  3. The Hex encoded character – breaks the abstract field

I was able to track down the bug to the formatAndResolveStrings method in the org.jabref.logic.bibtex.FieldWriter class where the first encounter of the # enforces that the abstract field is closed with a }.

Appendix

bug-1.txt
bug-2.txt

@Siedlerchr
Copy link
Member

Thanks for the report and also for the investigation/debugging. I guess the problem is related to the issue #7010 and #7012
The problem is that a "#" can indicate a BibTeX string https://docs.jabref.org/advanced/strings constant.

@Siedlerchr Siedlerchr added entry-editor export / save bug Confirmed bugs or reports that are very likely to be bugs labels Dec 6, 2021
@kristofmeixner
Copy link
Contributor Author

Thanks for the report and also for the investigation/debugging. I guess the problem is related to the issue #7010 and #7012 The problem is that a "#" can indicate a BibTeX string https://docs.jabref.org/advanced/strings constant.

Yes. I guess it might make sense to transform such characters while reading the field to Unicode characters.

@Siedlerchr
Copy link
Member

@Mercynary I think I found a workaround/solution. In the Preferences -> File -> Check "Resolve strings for all fields exept"
and add comment and abstract to the list of fields with semicolon
grafik

Siedlerchr added a commit that referenced this issue Jan 3, 2022
Siedlerchr added a commit that referenced this issue Jan 13, 2022
* Change default behavior of resolve bibtex strings

Fixes #7010
Fixes #7012
Fixes #8303

* Renaming of fields

* fix prefs, remove migration

* Fix gui properties and l10n

* adjust defaults, fix bst tests

* remove obsolete test
Fix changelog

* fix checkstyle

* fix another test

* fix comment

* Fix typos

* add institution

* Sort fields alphabetically

* Group prefernces at "File": BibTeX strings, Loading, Saving

* Remove unused imports

* Add ADR-0024

* Add test for comment field

* fix tests

* Fix markdown in ADR-0024

* ADR-0024: Fix filename and addr to adr.md

* ADR-0019: Fix typo

* Remove obsolete empty line

* Introduce BIBTEX_STRING_START_END_SYMBOL and remove negation

- Add org.jabref.logic.bibtex.FieldWriter#BIBTEX_STRING_START_END_SYMBOL
- !doNotResolveStrings -> resolveStrings

* Remove deprecated constructor FieldWriterPreferences()

* Fix test on Windows (CRLF issue)

* Add missing context information

* Add more tests

* Fix negation

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
@Siedlerchr
Copy link
Member

@Mercynary In the latest development version we changed the whole logic and enable BibTeX string resolving only for a couple of fields. This can be adjusted in the options

@koppor koppor moved this to Done in Prioritization Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs entry-editor export / save
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants