Add more advice on escaping {{
to readme (#356)
This commit is contained in:
parent
3e181614d3
commit
c39d88cc2b
15
README.adoc
15
README.adoc
@ -224,11 +224,22 @@ publish:
|
||||
rm -rf {{tarball}} {{tardir}}
|
||||
```
|
||||
|
||||
To write a recipe containing `{{` or `}}`, use a string literal inside of `{{...}}`:
|
||||
==== Escaping `{{`
|
||||
|
||||
To write a recipe containing `{{`, use `{{ "{{" }}`:
|
||||
|
||||
```make
|
||||
braces:
|
||||
echo 'I {{ "{{" }}LOVE{{ "}}" }} curly braces!'
|
||||
echo 'I {{ "{{" }}LOVE}} curly braces!'
|
||||
```
|
||||
|
||||
(An unmatched `}}` is ignored, so it doesn't need to be escaped.)
|
||||
|
||||
Another option is to put all the text you'd like to escape inside of an interpolation:
|
||||
|
||||
```make
|
||||
braces:
|
||||
echo '{{'I {{LOVE}} curly braces!'}}'
|
||||
```
|
||||
|
||||
=== Strings
|
||||
|
Loading…
Reference in New Issue
Block a user