👌 IMPROVE: Support for keeping abbreviations at enclosing values. by lartpang · Pull Request #491 · sciunto-org/python-bibtexparser
@MiWeiss Thanks for your review.
In principle, I try to keep a match between "Parse" and "Write" Middleware, where the latter (partially) reverts the first. In your case: The strings were dereferenced in
ResolveStringReferencesMiddleware, thus they should be put back in aResolveStringReferencesMiddleware(in interpolate.py). I see how that's not very straight forward (as its very connected to the enclosings) - but please try to consider moving your solution in that direction. Then, if you absolutely can't find a nice solution, just say so. I'll have a look and re-evaluate (I'm a bit short on time atm).
ResolveStringReferencesMiddleware is used to resolve string objects in bibtex, which seems to conflict with the feature of retaining string objects in this commit:
Because if ResolveStringReferencesMiddleware is used, it explicitly indicates that string objects should be resolved, so there would be no need to emphasize "retaining string objects" additionally.
The requirement to "retain string objects" only exists when enclosing values (maybe), which seems difficult to decouple from the operation of AddEnclosingMiddleware.