Open lann opened 5 months ago
I believe liquid templates support the {% raw %} {{something}} {% endraw%}
syntax.
{% raw %}{{ not interpolated }}{% endraw %}
I don't hate it. It's a little odd to introduce "tag" syntax just for raw
but at least it's familiar.
For what it's worth this is mentioned at https://developer.fermyon.com/spin/v2/template-authoring#expression-syntax (we've hit this before).
@lann The "tag" syntax is not only for raw
. As far as I know we support all Liquid tags e.g. if
, case
, for
(see e.g. https://shopify.github.io/liquid/tags/control-flow/) -- we have just not had occasion to use them.
Sorry, words are hard. This issue is referring just to the runtime config "templating", i.e. what was once called spin-config
, is now mostly referred to as spin-variables
, and is implemented in spin-expressions
. I wasn't thinking about Spin "templates". :neutral_face:
That said, it probably is worth considering how this would interact with spin-templates, which might be an argument against {% raw %}
escaping.
Of course it is. My brain jumped tracks at the mention of Liquid, which of course was given as an example/analogy and did not mean Spin templates. My apologies.
Doesn't look like this will make Spin 3.0 so untethering...
The current Mustache-inspired template syntax has no way of escaping double open quotes (
{{
).While no one has complained about this yet (loudly enough for me to hear), we should probably proactively fix this as it would technically introduce a breaking change.
Some options:
\
escaping. Annoyingly, this would require double-backslash in TOML, but given the evident rarity of needing this maybe that is fine.Other suggestions welcome.