Skip to content

improve handling of tokens ending with braces #185

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

Merged
merged 3 commits into from
Feb 15, 2022

Conversation

MasterOdin
Copy link
Collaborator

Fixes #184

Tokens may contain any character, including a } at its end. The current parser to detect tokens greedily picks up the sequence }}, which does not include any number of trailing } which would actually end the token. For example, given {{{ a }}}, the parser would detect the token as { a, and leave a trailing } on the line, when the actual token is { a }.

This PR modifies our regex so that we include any number of } characters greedily before our final }} that closes the token, so that we force the final }} as our token closure. This looks like it handles both examples given in #184 as expected, and a quick look did not show any pages as looking abnormal.

@MasterOdin MasterOdin merged commit f17976a into main Feb 15, 2022
@MasterOdin MasterOdin deleted the mpeveler/bugfix-tokens branch February 15, 2022 13:07
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.

Coloring for printed { } is broken
1 participant