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

JabRef saves file that break its own parser #1204

Closed
mkaut opened this issue Apr 14, 2016 · 3 comments
Closed

JabRef saves file that break its own parser #1204

mkaut opened this issue Apr 14, 2016 · 3 comments
Milestone

Comments

@mkaut
Copy link

mkaut commented Apr 14, 2016

JabRef version 3.2 on Windows 10.

Steps to reproduce:

  1. start the bib-file with the following:
% Encoding: windows-1252
@PREAMBLE{ {\providecommand{\noopsort}[1]{}} }
@STRING{annalsofor = {Annals of Operations Research}}
  1. open in JabRef (should open fine)
  2. save the file
  3. open again .. here, I either get an "Error opening file" if opening a new instance, or nothing happens (no file get opened, no error) if opening from a running instance.

When I open the .bib-file in a text editor, I see that the first line was changed to:

% Encoding: windows-1252@PREAMBLE{ {\providecommand{\noopsort}[1]{}} }



@STRING{annalsofor = {Annals of Operations Research}}

i.e., there is a missing line break before the preamble (and extra line breaks after).
This happens also if the preamble is after all string definitions.

Note that the bug in the parser has been reported before #(b2a9631), but this is more serious since JabRef itself saves the file in a format that it cannot open.

In addition, the fact that I do not even get an error when opening the file from a running instance (i.e., nothing happens) is most likely also an error.

@stefan-kolb
Copy link
Member

Thank you for your report 👍
This should be fixed in current master. Please try the latest build from http://builds.jabref.org/master.

@stefan-kolb stefan-kolb added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Apr 14, 2016
@mkaut
Copy link
Author

mkaut commented Apr 14, 2016

I can confirm that it is fixed in the master (tested the .jar file).

As a side node, I see that there is a small change in the output formatting again (Preamble vs. PREAMBLE and Comment vs. comment). Is there any plan to make the formatting stable by some version?
(We are a group sharing a .bib file via SVN and currently sit on v.2.9.2, since after that the formatting has changed with almost every release, creating problems with version control..)

@koppor
Copy link
Member

koppor commented Apr 14, 2016

We are really heading to get these things stable. See #116.

The current decision is that we rewrite entries only if they are changed. This should enable working with different versions easily.

The thing is, that it seems that this is not implemented for @String and @Comment.

@koppor koppor added this to the v3.3 milestone Apr 14, 2016
@koppor koppor closed this as completed Apr 14, 2016
@koppor koppor removed the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Apr 14, 2016
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