aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-05-27 10:14:32 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-05-27 10:14:32 +0200
commitac4aaf6503f7e13641cbdd8fba2c4a10b81b1f97 (patch)
treede259d21351c3b26dd0ae763cbbf014b5e7e3a14
parent3ba47e3fba811c073fc0623374f15861191d2edf (diff)
downloadaskama-ac4aaf6503f7e13641cbdd8fba2c4a10b81b1f97.tar.gz
askama-ac4aaf6503f7e13641cbdd8fba2c4a10b81b1f97.tar.bz2
askama-ac4aaf6503f7e13641cbdd8fba2c4a10b81b1f97.zip
Add note about calling methods and warn about stack overflow
Diffstat (limited to '')
-rw-r--r--askama/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/askama/src/lib.rs b/askama/src/lib.rs
index 823d48f..a83aab2 100644
--- a/askama/src/lib.rs
+++ b/askama/src/lib.rs
@@ -258,6 +258,12 @@
//! Expressions can be grouped using parentheses.
//! The HTML special characters `&`, `<` and `>` will be replaced with their
//! character entities unless the `escape` mode is disabled for a template.
+//! Methods can be called on variables that are in scope, including `self`.
+//!
+//! **Warning**: if the result of an expression (a `{{ }}` block) is
+//! equivalent to `self`, this can result in a stack overflow from infinite
+//! recursion. This is because the `Display` implementation for that expression
+//! will in turn evaluate the expression and yield `self` again.
//!
//! ## Comments
//!