-
-
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
Saved file cannot be read #1212
Comments
Hm, I wonder why and where all this escaping and reformatting takes place on save. Didn't we decide to do no automatic reformatting of entries on save except for save actions. Critically, a closing curly bracket is entered This is not a problem in the parser, which just quits after |
I do not fully agree on the details. Assume a field in JabRef which reads Now, as JabRef decided to use ## to separate field content from string labels, we can make the assumption that everything between two ## is a string label and then we put requirements on how that should look. A single #, as in #1188 is harder to actually know if it is expected or a problem. |
We just tested this and it is still broken (but fortunately nobody else seems to have bumped into it). @oscargus: Do you maybe want to have a go at it? |
I just tested this again. At the very least, the file can be read now, just that one particular entry will be ignored. That is a step up from not reading the file at all, I would say. Essentially, what is missing here is a warning on writing the database to disk or when entering the illegal characters. |
Based on the discussion in #1188 I created an empty database with a single entry with a single field containing
––
, which is saved asLog messages:
WARN net.sf.jabref.importer.fileformat.BibtexParser - Could not parse entry
java.io.IOException: Error in line 4 or above: Empty text token.
This could be caused by a missing comma between two fields.
WARN net.sf.jabref.importer.fileformat.BibtexParser - Could not parse entry
java.io.IOException: Error in line 4: Expected { or ( but received }
I notice two things here, except that it doesn't work (I think one reason is that a string cannot start with a digit as I recall it, although that is probably not the reason here). First, & is escaped. Why? What if I want to have a & in my field? One reason could be in an abstract where a slightly more complicated equation or tabular might theoretically be included. Second, there should probably be a space after the second #. Although not strictly required, it would be nice for symmetry.
Suggestion: check if what JabRef believes to be a string, i.e., content between two # is a valid string label, if not make the user sort it out,
The text was updated successfully, but these errors were encountered: