From ac4aaf6503f7e13641cbdd8fba2c4a10b81b1f97 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sun, 27 May 2018 10:14:32 +0200 Subject: Add note about calling methods and warn about stack overflow --- askama/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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 //! -- cgit