[!!!][FEATURE] Alternative Fluid syntax in CDATA #1246
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fluid has so far removed any CDATA sections from templates. This has
been introduced with 978071f, without any clear indication why this
was done. This means that Fluid templates either expect CDATA sections
to be removed or avoid them altogether since they don't do anything.
This gives us the opportunity to not only re-add those sections to
Fluid templates (which is a breaking change), but to also introduce
new syntax within those section.
One common issue with the Fluid parser has always been that the
variable/inline syntax collides with both CSS and JS, which both use
curly braces quite extensively. In most cases, this leads to the
Fluid parser trapping over a curly brace that's not intended for Fluid
and then stops interpreting valid Fluid syntax after that.
This patch extends the Fluid parser to use alternative variable and
inline syntax within CDATA sections in the template. Both ViewHelper
tag syntax and the normal curly braces syntax no longer work there,
instead three curly braces
{{{ }}}can be used to access Fluidvariables, call ViewHelpers and use expressions. The CDATA keyword
itself is removed from the output.
Resolves: #1012
Resolves: #808