-
Notifications
You must be signed in to change notification settings - Fork 132
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
handling of new blocks that aren't on a new line #411
Comments
fixed via PR, I think - please check and merge... |
Hi Thanks a lot for your bug report and also for opening the PR! I can confirm that the library assumes that new entries start on a new line. I went through a range of standard bibtex documentation and - while they all seem to implicitly assume this - it does not seem to be stated anywhere explicetly, making this a valid bug. 🐛 Your PR still has breaking tests and I am afraid more changes would be necessary to implement the function correctly. Would you be able to dedicate more time to it? If not, I am greatful for a quick heads-up, allowing me to open this issue for other contributors. |
Hi I just wanted to add that entries starting on a new line but have leading whitespace (before the |
For reference, see also PR #412 |
The original BibTeX skips everything else until finding an |
Thanks @zepinglee for opening #416. I have assinged the issue to you. |
Describe the bug
V1 handled input files where the new blocks (indicated by @) aren't necessarily on a new line.
V2 attempts to ignore these, but instead get's into a real mess, because they end up being 'nested' within other entries. If they were properly ignored (i.e. parsed and dropped), then it would kind of be ok and consistent, but they make it into the raw data for each entry.
This leads to all sorts of problems. They will reappear, for example, when you write the library back out to a file later!
Very confusing.
IMHO, they should be treated as valid blocks and handled properly. I've tested a fix for this locally and it appears to work OK.
Reproducing
Version: latest
Code:
parse any file with inline new blocks, e.g.;
parsed_lib = bibtexparser.parse_file(filename)
Bibtex:
Workaround
Did you identify a workaround? Yes - I will send a pull request...
Remaining Questions (Optional)
Please tick all that apply:
The text was updated successfully, but these errors were encountered: