From 6cd17ff7d87ba0a041f2e33b6989c4a8094d0a88 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 11 Nov 2024 09:38:27 +0200 Subject: [PATCH] settings: Fix/clarify %variable escaping --- docs/core/settings/types.md | 4 ---- docs/core/settings/variables.md | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/core/settings/types.md b/docs/core/settings/types.md index 0a90743c5..545701385 100644 --- a/docs/core/settings/types.md +++ b/docs/core/settings/types.md @@ -59,10 +59,6 @@ dovecotlinks: String can contain any character. Strings support [[variable]]. -::: tip -If you need the `%` character verbatim you have to escape it as `%%`. -::: - ## String without variables Certain settings require specific variables and thus don't use the default diff --git a/docs/core/settings/variables.md b/docs/core/settings/variables.md index 6375ec41c..abe179a2c 100644 --- a/docs/core/settings/variables.md +++ b/docs/core/settings/variables.md @@ -53,7 +53,11 @@ Filters can accept parameters, both positional and named. E.g. `%{literal('\r\n\ to CR LF. `%{user | substr(0, 1)}` will take first character of username. Example of named parameters would be `%{user | md5(rounds=1000,salt='pepper')}` -You can use `%%{variable}` to escape this, and emit `%{variable}`. +For escaping: + * `%%{text}` emits `%{text}` + * `%%%{text}` emits `%%{text}` + * `%{concat('%', variable)}` emits `%` + * Otherwise `%` doesn't need any escaping. `%%` emits the same `%%`. Filters accept strings, numbers and variables as parameters. Parameters can be positional or named key-value pairs. Key names cannot be variables.