Skip to content

Commit d4129a9

Browse files
sirainencmouse
authored andcommitted
settings: Fix/clarify %variable escaping
1 parent 4dba262 commit d4129a9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/core/settings/types.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ dovecotlinks:
5959

6060
String can contain any character. Strings support [[variable]].
6161

62-
::: tip
63-
If you need the `%` character verbatim you have to escape it as `%%`.
64-
:::
65-
6662
## String without variables
6763

6864
Certain settings require specific variables and thus don't use the default

docs/core/settings/variables.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ Filters can accept parameters, both positional and named. E.g. `%{literal('\r\n\
5353
to CR LF. `%{user | substr(0, 1)}` will take first character of username. Example of named parameters
5454
would be `%{user | md5(rounds=1000,salt='pepper')}`
5555

56-
You can use `%%{variable}` to escape this, and emit `%{variable}`.
56+
For escaping:
57+
* `%%{text}` emits `%{text}`
58+
* `%%%{text}` emits `%%{text}`
59+
* `%{concat('%', variable)}` emits `%<expanded variable>`
60+
* Otherwise `%` doesn't need any escaping. `%%` emits the same `%%`.
5761

5862
Filters accept strings, numbers and variables as parameters. Parameters can be positional or
5963
named key-value pairs. Key names cannot be variables.

0 commit comments

Comments
 (0)