samskivert / jmustache

A Java implementation of the Mustache templating language.
Other
827 stars 129 forks source link

[FR] - Limit recursion to a specific depth #167

Open agentgt opened 6 months ago

agentgt commented 6 months ago

Mustache allows recursive partials and JMustache supports this but for many this can be dangerous especially if JMustache is used to render user templates.

Currently I believe the only depth limit is the actual Java method stack depth limit or in other words StackOverflow.

I believe a simple options of depth limit would be a nice feature for JMustache to have. I'm happy to submit a PR @samskivert this coming year.

samskivert commented 6 months ago

Sounds reasonable.