Skip to content

Punctuation commands fix (Issue #111)#116

Merged
alvinwan merged 5 commits into
alvinwan:masterfrom
minireference:punctuation_fix
Oct 19, 2020
Merged

Punctuation commands fix (Issue #111)#116
alvinwan merged 5 commits into
alvinwan:masterfrom
minireference:punctuation_fix

Conversation

@ivanistheone

Copy link
Copy Markdown
Contributor

@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").

@ivanistheone ivanistheone changed the title Punctuation commands fix Punctuation commands fix #111 Oct 18, 2020
@ivanistheone ivanistheone changed the title Punctuation commands fix #111 Punctuation commands fix (Issue #111) Oct 18, 2020
@coveralls

Copy link
Copy Markdown

Coverage Status

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

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

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

Comment thread TexSoup/tokens.py
for point in PUNCTUATION_COMMANDS:
if text.peek((0, len(point))) == point:
result = text.forward(len(point) + 1)
result = text.forward(len(point))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

credit hint in #111 (comment)

@alvinwan

Copy link
Copy Markdown
Owner

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

@alvinwan alvinwan merged commit 71d4c06 into alvinwan:master Oct 19, 2020
@alvinwan alvinwan mentioned this pull request Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants