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

Treat starting single quote as verbatim text in Slim #17085

Merged
merged 3 commits into from
Mar 10, 2025
Merged

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Mar 9, 2025

This PR fixes an issue in Slim templates where a single quote ' at the start of the line (excluding white space) is considered a line indicator for verbatim text. It is not considered a string in this scenario.

So something like this:

div
  'Foo'

Will compile to:

<div>Foo'</div>

Fixes: #17081

Verified

This commit was signed with the committer’s verified signature.
jdonszelmann Jana Dönszelmann
@RobinMalfait RobinMalfait requested a review from a team as a code owner March 9, 2025 10:08

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Member

@philipp-spiess philipp-spiess left a comment

Choose a reason for hiding this comment

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

I wonder if our pre-processor logic should also only process stuff per-line so we avoid this kind of behavior? 🤔

@RobinMalfait
Copy link
Member Author

@philipp-spiess I was thinking about that as well, but it makes it potentially harder for other checks where [ and ] needs to be balanced but they might be spread across multiple lines 🤔

@RobinMalfait RobinMalfait merged commit cc3e852 into main Mar 10, 2025
5 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-17081 branch March 10, 2025 10:45
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.

4.0.12 - Regression with SLIM templates (single quotes)
2 participants