Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with whitespace controls not applying properly #599

Merged
merged 5 commits into from
Feb 17, 2021

Conversation

mattcoley
Copy link
Collaborator

@mattcoley mattcoley commented Feb 17, 2021

Whitespace controls operate on the assumption that textnodes cannot be adjacent. You can break up text nodes with a comment node \n {# comment #} \n. This should not affect the whitespace control but it does under the current code. In order to solve for this I merged adjacent text nodes. I did try a few other approaches over a couple of hours to try to get the same effect but could not solve for the case where there are more than 2 text nodes stacked next to each other.

@mattcoley mattcoley requested a review from jasmith-hs February 17, 2021 05:25
Copy link
Contributor

@jasmith-hs jasmith-hs left a comment

Choose a reason for hiding this comment

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

This seems like a good solution. We essentially want the adjacent text tokens to be treated as the same token when handling whitespace, so merging them makes sense.

@mattcoley mattcoley merged commit 5474786 into master Feb 17, 2021
@mattcoley mattcoley deleted the fix-whitespace-breakup branch February 17, 2021 13:59
@jasmith-hs jasmith-hs mentioned this pull request Oct 30, 2023
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.

2 participants