Describe the bug
The splitter classifies block types with startswith, so valid custom entry
types whose names begin with comment, preamble, or string are routed to a
special-command parser instead of the ordinary entry parser.
For example, @commentary, @preamble_study, and @string_theory do not become
entries even though only the exact case-insensitive names comment, preamble,
and string should select those special block forms.
Reproducing
Version: current main (08e370a)
Code:
from bibtexparser import parse_string
for entry_type in ("commentary", "preamble_study", "string_theory"):
library = parse_string(
f"@{entry_type}{{key, title = {{Custom entry type}}}}"
)
assert [(entry.entry_type, entry.key) for entry in library.entries] == [
(entry_type, "key")
]
The assertions fail on current main because the blocks are treated as special
commands rather than custom entries.
Expected behavior
Special-command dispatch should use an exact case-insensitive type comparison.
Longer custom type names should remain ordinary entries.
Workaround
Rename custom entry types so they do not begin with a special command name.
Remaining Questions (Optional)
Describe the bug
The splitter classifies block types with
startswith, so valid custom entrytypes whose names begin with
comment,preamble, orstringare routed to aspecial-command parser instead of the ordinary entry parser.
For example,
@commentary,@preamble_study, and@string_theorydo not becomeentries even though only the exact case-insensitive names
comment,preamble,and
stringshould select those special block forms.Reproducing
Version: current
main(08e370a)Code:
The assertions fail on current
mainbecause the blocks are treated as specialcommands rather than custom entries.
Expected behavior
Special-command dispatch should use an exact case-insensitive type comparison.
Longer custom type names should remain ordinary entries.
Workaround
Rename custom entry types so they do not begin with a special command name.
Remaining Questions (Optional)