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 parsing comment tag delimiter #1763

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Conversation

ggmichaelgo
Copy link
Contributor

@ggmichaelgo ggmichaelgo commented Nov 30, 2023

What are you trying to solve?

#1755 introduced a bug to comment tag parsing.

The comment tag uses this regex to match the tag delimiter:

 /\A(.*)(?-mix:\{\%)-?\s*(endcomment)\s*(.*)?-?(?-mix:\%\})\z/m

After matching the endcomment, the regex is also matching the extra string with \s*(.*)?
Since it doesn't require a whitespace after matching with the tag delimiter, it allows delimiters like {% endcommentABC %} to be matched.

@ggmichaelgo ggmichaelgo merged commit cbb422e into main Dec 1, 2023
9 checks passed
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