Repository navigation
fix: keep BibTeX quoted values that contain a braced quote - #2158
Open
jayhemnani9910 wants to merge 1 commit into
Open
jayhemnani9910 wants to merge 1 commit into
jayhemnani9910 wants to merge 1 commit into
Conversation
In a quoted BibTeX value a double quote is written inside braces, as in
title = "The {"}Quoted{"} Paper". The converter ended the value at the
first quote, so the title became "The" and the entry lost its remaining
fields. Only end a quoted value at a quote outside braces.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In a quoted BibTeX value, a literal double quote is written inside braces:
title = "The {"}Quoted{"} Paper"._read_quotedand the quoted state in_scan_entryend the value at the first", even inside braces, so the title becomesTheand the rest of the entry's fields are lost:Before:
## 1. Thewith no authors or year.After:
## 1. The "Quoted" Paper,**Authors:** Jane Doe,**Year:** 2020.A quote now ends a quoted value only outside braces, the same rule #1622 applied at the entry's top level.
A regression test is added to
tests/utils/test_bibtex_converter.py; it fails ondevand passes with this change.Related Issues
Module(s) Affected
utilstestsChecklist
dev(notmain— see the base-branch selector above).pre-commit run --all-filesand fixed any issues. (Ranruff checkandruff format --checkon the changed files, andpytest tests/utils: 143 passed.)