Unittest: assure preamble parses with arbitrary brackets#7768
Conversation
|
Regarding the preamble I found this Tex StackExchange answer which provides some more info of the preamble and the allowed format and how it's used in bibtex |
| void parseRecognizesPreambleWithArbitraryBracketPairAndSpace() throws IOException { | ||
| ParserResult result = parser | ||
| .parse(new StringReader("@preamble{some ( {text )}) and \\latex}")); | ||
| // |> the rest got cut-off |
There was a problem hiding this comment.
I do not understand "got cut-off". Can you elaborate? Maybe, it is just not required, beucause the preamble itself is tested.
There was a problem hiding this comment.
so in current implementation, as long as jabref get enough of pairing brackets, in this case { ( { ) } ), it returns immediately and ignores the rest of the input.
Thank you for the link. The link should also be added to JabRef's preamble-parsing source. JabRef should be able to parse even invalid files, because users want to edit their library using JabRef - and not fall back to other tools not having parsing issues. @gwy15 Thank you for your contribution. Since we take each contribution serious, please also be reminded that this contribution causes us energy to think about it. Thus, these comments. Since you are also in the context of pre-amble-parsing, you can think of more on it. Can you, for instance, check whether the user documentation also has correct content for preamble handling? Other than that, I would not spend much more energy here. I do not know any user using the premable feature. |
The preamble part of the bibtext parser (logic/importer/fileformat/BibtextParser) has a
parseBracketedTextmethod that accepts any pairing of curly bracket and round bracket, for exampleis acceptable.
I'm writing a new test case for that to indicate that this 'feature' is tested so that developers should know this is a feature not a bug.
I assume that this is designed as is, so that it won't break on opening current acceptable bibtex files. But if this is indeed a bug, please let me know so that I can get a PR for this.
CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)