alvinwan / TexSoup

fault-tolerant Python3 package for searching, navigating, and modifying LaTeX documents
https://texsoup.alvinwan.com
BSD 2-Clause "Simplified" License
290 stars 43 forks source link

Punctuation commands fix (Issue #111) #116

Closed ivanistheone closed 4 years ago

ivanistheone commented 4 years ago

@alvinwan said: Is it maybe because of the following line? (maybe should be len(point)? result = text.forward(len(point) + 1)

Yes indeed. After this change PunctuationCommandNames no longer "gobble" the following charaacter and seem to behave as expected.

I've added some tests (if tokens serialize back to string correctly, then they must have been tokenized together as a unit). By coincidence I happened to choose a delimiter \rfloor and test was failing... so we ended up with a bonus typo fix.

Last but not least I added three more verbatim-type environments (users can manually add those to skip_envs if needed, but seems like a good idea to have them "baked in").

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 54a8c9ec89207eb53eeca46e5e2bb92c9666272a on minireference:punctuation_fix into 942bb572312c97b02881bb7486456a8bdab0c612 on alvinwan:master.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 54a8c9ec89207eb53eeca46e5e2bb92c9666272a on minireference:punctuation_fix into 942bb572312c97b02881bb7486456a8bdab0c612 on alvinwan:master.

alvinwan commented 4 years ago

Many thanks for the PR @ivanistheone! Haha now I'm wondering why I ever added that +1. Accepting and merging.