-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Jabref removes comments inside the Bibtex code #1026
Comments
Everything outside of an entry is a comment and should, if possible, be kept. This is not an answer to your question though, just a statement. |
Actually it is not at the moment at least for me. |
I assume that the comment will be overwritten if the entry is reformatted. Otherwise, it is kept as part of the parsed serialization of the entry. As far as I know, JabRef has always overwritten such comments, but we might consider to change this functionalty (this has strong implications on parsing/writing) |
Right now everything not contained in an entry (or @comment tag) is completely ignored by the parser. In particular, it is not saved anywhere and gets lost on rewrite. The problem with this floating-around text is that is not connected to any entry and thus the new position of it can not be determined on save. By the way, even user-defined @comment tags get lost. |
I can understand that it is hard to keep everything for sure and I think that it is OK to some extent. If you use JabRef you do not need to do manual edits... |
The fact that JabRef destroys content of the the |
Adding a datastructure to
|
From Devcall: We will try to keep all text in the file at the same position. I will have a look at how to implement this. |
I had a first look at this. Unfortunately, this would be very very very ugly. It would essentially require a rewrite of the parsing logic. As it turns out, arbitrary comments are not stored at the moment even for the parsed serialization. A few things contribute to making this complicated:
Since the serialization details are quite a nasty and un-fun part of work I hesitate to revisit (I have spent a good dozen hours only to get newline parsing correct for all of many different occasions) and it is not very motivating to throw large parts of what I wrote during the last three versions into the gutter again, I might not volunteer for implementing this. Btw.: If it helps, currently all text after the last entry is kept. |
@stefan-kolb: For some external control, could you please try out your example from above with #1471 This should preserve the comment in any case. If the entry is reformatted, an empty line will move between the entry and the comment, if unchanged it should be rewritten exactly as is. |
@stefan-kolb: Any updates here? |
Right now it keeps the comment, but inserts an additional newline between the comment and the entry. |
The newline is inserted if you change the entry, right? That is the desired behavior on reformatting. If you do not change the entry, the comment should stay as is. |
If that's desired everything is ok now. |
@lenhard Do we intend to do this? i thought we keep the source as is if possible?
%% author = {Ahronovitz, Miha and Amrhein, Dustin and Anderson, Patrick and De, Andrew} @misc{Ahronovitz2010a, author = {{Cloud Computing Use Case Discussion Group}}, title = {Cloud {Computing} {Use} {Cases} {White} {Paper} - {Version} 4.0}, date = {2010-07} }
Will get
This will only be done when changing the entry right?
The text was updated successfully, but these errors were encountered: