Fix mixed CRLF / CR#8238
Merged
Merged
Conversation
1 task
Siedlerchr
reviewed
Nov 13, 2021
# Conflicts: # src/main/java/org/jabref/gui/preferences/file/FileTabViewModel.java # src/main/java/org/jabref/preferences/ImportExportPreferences.java # src/main/java/org/jabref/preferences/JabRefPreferences.java # src/main/java/org/jabref/preferences/PreferencesService.java
Member
|
Might be Related |
Siedlerchr
approved these changes
Nov 13, 2021
Member
Author
|
This PR makes #8239 still necessary. - This PR "only" ensures that line endings are consistent when writing. The implementation here decided to normalize right before the writing. That means, methods to change field contents etc are left untouched. The decision was to have one single place to ensure consistency than touching all methods handling field content. I know that this is not the best solution: Field contents should also be normalized so that algorithms working on it work correctly. Nevertheless, this is IMHO a big step in the right direction and makes JabRef working good again. |
Member
|
You need to remove the comment In OS.java |
calixtus
approved these changes
Nov 14, 2021
Siedlerchr
added a commit
that referenced
this pull request
Nov 19, 2021
* upstream/main: (181 commits) Add of ADRs 22 and 23 (#8256) [Bot] Update CSL styles (#8245) Replace styfle/cancel-workflow-action@0.9.1 by GitHub's "concurrency" feature (#8243) Bump gittools/actions from 0.9.10 to 0.9.11 (#8248) Bump commons-cli from 1.4 to 1.5.0 (#8250) Bump byte-buddy-parent from 1.12.0 to 1.12.1 (#8249) Bump antlr4 from 4.9.2 to 4.9.3 (#8251) Bump archunit-junit5-api from 0.21.0 to 0.22.0 (#8252) Fix search: NOT binds more than AND (#8241) New Crowdin updates (#8240) Make PdfGrobiImporterTest as FetcherTest Oobranch g : add actions (#7792) Fix mixed CRLF / CR (#8238) Fix "Library has changed externally" with CRLF markers (#8239) Fix for issue 8198, 8133 (#8229) Added more unit tests in AuthorTest (#8214) Add confirmation dialog for empty entries in JabRef (#8218) Fix entry editor column visibility (#8232) Use regexp to remove non-ASCII characters from DOI and inform user when data for valid DOI does not exist #8127 (#8228) Fix exception for search flags (#8237) ...
This was referenced Nov 20, 2021
Merged
This was referenced Feb 18, 2022
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sometimes, JabRef writes BibTeX files with mixed line endings. This PR fixes that.
I implemented a new class
BibWriter, which works similar toStringJoiner, but more tayloured to support our use case. The main ideas are a) newlines are normalized during write and b) the writer is aware of blocks. That way, the empty newline separating two entries is now a kind of internal data and not associated to any of the two entries. Moreover, there is no leading empty line at the beginning of a.bibfile anymore. --> fixes JabRef#390While I was on it, I also removed the
% Encoding: UTF8preamble, because Unicode is the most common encoding for the WWW since 2008.A bib file should keep the line break style. When collaborating on a network drive with different operating systems, the line breaks surely differ from the linebreaks in local files or in a drop box. Thus, the linebreaks of the
.bibfile itself should be respected. This is implemented in this PR. This fixes https://sourceforge.net/p/jabref/feature-requests/857. (See also #4877 (comment)).and the setting "Newline separator" should a) be respected, b) the newline separator of the.bibfile should be used (because in the case of multiple bib files, the separators might vary from file to file). -- The implementation of the latter is prepared. "Just" need to finish it.CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)