-
-
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
Unrobust reading of bad @Comment #1632
Comments
The |
Good link! If we trust it, I quote: Actually, the rule is that everything from the @comment and to the end of line is ignored. |
... I think the current implementation is "wrong" with respect to the information provided in the link as JabRef only accepts |
The tricky/interesting thing here is probably that by writing @comment instead of an entry type, the next lines are also treated as comments (as they do not start with @ or are inside a non-Comment entry type). So it is quite important to keep those comment lines. :-) |
I tried to find some more information on this topic, but I can't find any more details, if it used as block or not. |
I had a quick look at the parser. @matthiasgeiger: Currently, we accept @oscargus: The error occurs, because the parser expects something that starts with If I get this issue right we should be able to parse comments that are not followed by curly braces? I would really love some more official documentation on bibtex syntax (really an real official information you find would be very welcome), but I guess the best we have is a compiler. Last but not least: Note that the current implementation drops any user comments from the database, i.e., anything within |
@lenhard the official BibTex source can be found here: https://www.ctan.org/tex-archive/biblio/bibtex/base |
@Siedlerchr yes, unfortunately it is a bit scarce on comments. So far I do not see a consensus here. Is there something that we should change about the parser? @JabRef/developers what do you say? If yes, what exactly is it and how would the desired behavior look like? |
As far as I know What we should do is to display a more informative error message. |
I read up a bit and it seems like @comment in the (authoritative) BibTeX application works in two ways:
|
Have a look at #1638 Comments marked by Essentially, it took a mere five lines of code (one try catch block) and a change in one method call to implement this. The fact that so few changes are needed shows that we are finally making progress in the extensibility of JabRef. All the quality refactoring finally starts to pay of. I'm happy right now :-) |
@lenhard Loads well! Some (expected) info from the logger, but nothing else. It moved four entries for unknown reasons (from random places at the end to the beginning of the file), but unlikely that it has anything to do with this. No |
Fixed by #1638 |
JabRef version
I got a BIB file from a comment to clean up and it couldn't be read. The "Error opening file" gave the informative message "null".
The reasons seems to be this line:
as the log message says (the line above is line 5):
Not sure what I expect to happen, but maybe that the error message "Error in line 5: Expected { but received " is shown. Not sure if it is worthwhile to support this somehow understandable interpretation of @comment though...
The text was updated successfully, but these errors were encountered: