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

BibTeX source should not start with two empty lines #559

Closed
koppor opened this issue Dec 21, 2015 · 7 comments
Closed

BibTeX source should not start with two empty lines #559

koppor opened this issue Dec 21, 2015 · 7 comments

Comments

@koppor
Copy link
Member

koppor commented Dec 21, 2015

Due to #391, the "BibTeX source" contains two empty lines. This is explainable when discussing the implementation, but not understandable why JabRef breaks with the existing display of source and why users have to see two empty lines for each entry.

The source in the "BibTeX source tab" should contain the content from @ until }.

Current state:

grabbed_20151221-181005

Wanted display:

grabbed_20151221-181110

The only enhancement I would agree if comments in front of the entry would be stored. Currently, JabRef does not support comments.

grabbed_20151221-181043

@lenhard
Copy link
Member

lenhard commented Dec 21, 2015

Should be terribly easy to implement by using trim() in the preview panel, shouldn't it? Just go ahead and fixt it.

@koppor
Copy link
Member Author

koppor commented Dec 22, 2015

Side effect: When I use "send as Email", I also want to have the same rendering as in the BibTeX source. What if I do an HTML export? Then I also want to get the trimmed representation. What of other accesses of the BibTeX source. Does that quick fix really work for all usages?

@lenhard
Copy link
Member

lenhard commented Dec 22, 2015

We could offer a second getter for the representation getTrimmedSerialization or something similar. Then it really depends on the use case. I cannot tell if trim() is appropriate in all cases, but at least it is in yours :) I wrote the getParsedSerialization with file writing in mind.

@stefan-kolb
Copy link
Member

What is the reason for this two empty lines? Personally I would always expect the serialization of a sole entry to start with @ and end with }.

@lenhard
Copy link
Member

lenhard commented Dec 22, 2015

Because we decided that entries that have not changed should be written back exactly as they were read from the file: #116 That means newlines have to stored somewhere and prepending newlines are stored with the parsed serialization of an entry.

It seems that the entry editor uses the getParsedSerialization method from BibEntry and, therefore, displays the entry exactly as it was read from the file (including newlines).

@koppor
Copy link
Member Author

koppor commented Dec 23, 2015

It cannot be changed easily as it goes through the BibEntryWriter.

@lenhard
Copy link
Member

lenhard commented Dec 28, 2015

This has already been fixed with JabRef 3.2.

@lenhard lenhard closed this as completed Dec 28, 2015
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

No branches or pull requests

3 participants