feat: treat empty string as none when formating (#2738)

* treat empty string as none when formating

* update docs

* format & clippy
This commit is contained in:
filip
2021-06-30 01:33:43 +02:00
committed by GitHub
parent c811e0e5d5
commit 72e5a544fc
2 changed files with 36 additions and 3 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ A conditional format string wrapped in `(` and `)` will not render if all variab
For example:
- `(@$region)` will show nothing if the variable `region` is `None`, otherwise `@` followed by the value of region.
- `(@$region)` will show nothing if the variable `region` is `None` or empty string, otherwise `@` followed by the value of region.
- `(some text)` will always show nothing since there are no variables wrapped in the braces.
- When `$all` is a shortcut for `\[$a$b\] `, `($all)` will show nothing only if `$a` and `$b` are both `None`.
This works the same as `(\[$a$b\] )`.