-
-
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
Make BibTex parser more robust against missing newlines #677
Conversation
and fix bug that prevented the import of BibTex entries having only a key as content
if(atSymbolIndex > 0) | ||
encoding = line.substring(Globals.encPrefix.length(), atSymbolIndex); | ||
else | ||
encoding = line.substring(Globals.encPrefix.length()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please always use curly braces as this makes the semantics explicit.
👍 (except my minor comment) |
Corrected... for some reason the code style was not imported correctly in Intellij. |
Hm, I just use the default Intellij code style. :) |
Make BibTex parser more robust against missing newlines
@tobiasdiez: what do you think should be done to fix the above issues completely? |
@lenhard In my opinion JabRef should add new lines after the encoding and preamble. I'm working on a solution right now (including a 'bit' of refactoring to make testing easier). |
@tobiasdiez Ok, good to hear! I'll concentrate on other issues then. |
As described in #669 and #621 the parser has some problems when an entry (or preamble) follows directly the file encoding header (on the same line), i.e.
% Encoding: myEncoding @article{...}
.Actually, as the tests reveal it was not a problem with the actual parser but within the file opening logic.
I don't view this PR as a complete fix for #669 and #621 since not just the parser but also the serialization should be improved.
Also fix a bug that prevented the import of BibTex entries having only a key as its content.