spinframework / spinframework/spin
Add escape syntax to variables expansion syntax (`spin-expressions`)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
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.var1 = "\\{{ not interpolated }}" var2 = "one backslash: \\\\" # 😬- Some kind of quoted literal in braces, like Go templates:
var1 = "{{`{{`}} not interpolated }}" # or var1 = "{{`{{ not interpolated }}`}}"
Other suggestions welcome.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the spin-expressions parser and its existing interpolation tests. Review the proposed backslash and quoted-literal approaches, choose and document an escaping syntax, then add coverage showing literal {{ text and normal variable expansion still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100