-
Notifications
You must be signed in to change notification settings - Fork 101
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
Products.PageTemplates (with chameleon): bad comment handling #716
Comments
I'm pretty sure it's intentional: https://github.com/malthe/chameleon/blob/master/src/chameleon/zpt/program.py#L657 But if this is not Zope default behavior (and I'm guessing it's not), then it should be behind a feature gate. Then normally, that feature gate is disabled in the Zope integration (z3c.pt). |
Malthe Borch wrote at 2019-10-24 03:31 -0700:
I'm pretty sure it's intentional: https://github.com/malthe/chameleon/blob/master/src/chameleon/zpt/program.py#L657
You are likely right *BUT* this "feature" has not been well thought through:
`chameleon` has the construct `${<expression>}` in two places:
1. as part of `string` expressions and 2. free standing.
In the first case, it is a generalized form of `$<variable>` and
should behave like this one (my example shows that this is currently
not the case). It is escaped by doubling `$`; `\` escaping is not
supported.
In the free standing case, it can be `\` escaped.
Apparently, inside a comment, the `$(<expression>)` is always
treated as free standing even it is part of a `string` expression.
This calls out for surprises when a template block is commented out.
|
Agreed. But the solution in this case is to comment using I agree that it might not be the best thought-through feature. But then again, commenting out TAL should be done using |
The current Zope switches from its own page template implementation to |
Yeah that's exactly it. And as I mentioned, that "feature" should probably be put behind a configuration flag which is pretty easy to do. I'll see if I can find the time to set it up. |
This kind now be disabled using |
Some comments are badly handled.
This works
This does not:
Apparently, sometimes, expressions in comments are (wrongly) evaluated.
This is almost surely a
chameleon
bug.The text was updated successfully, but these errors were encountered: