FlamingTempura / bibtex-tidy

Cleaner and Formatter for BibTeX files
https://flamingtempura.github.io/bibtex-tidy/
MIT License
832 stars 63 forks source link

Keep braces directly around a command (#423) #426

Closed jdujava closed 5 days ago

jdujava commented 6 months ago

Tried to come up with fix for #423, when command enclosed with braces leads to broken formatted output.

Now, when command is directly enclosed with braces (meaning {...\foo}), the braces are just kept. Seems to me, that this should be the intended behavior (does not break inputs of the form hello{\foo}world).

Fixes #423.

FlamingTempura commented 5 days ago

Thanks @jdujava, and apologies for delay in responding. I've merged this change.

I made one change: it will keep braces with any command inside, not just if it contains just a command. E.g. the braces in {\bf foo} bar will be kept, to ensure that bold only applies to 'foo' not 'bar.

Unfortunately, because I modified the commit and merged manually GH hasn't spotted that it was merged :(

jdujava commented 5 days ago

No worries @FlamingTempura. I'm glad to see you implemented a proper fix.

By the way, #423 can be closed now, right?