dcwatson / bbcode

A pure python bbcode parser and formatter.
BSD 2-Clause "Simplified" License
68 stars 17 forks source link

Added `max_tag_depth` parser option to limit tag nesting #31

Closed Lanny closed 5 years ago

Lanny commented 5 years ago

Added max_tag_depth parser option to limit the amount of tag nesting that will be rendered. Current behavior is than an arbitrary number of nested tags will be accepted, however at some point formatting will run over the max tag depth and throw.

Set the default to 0, meaning unlimited tag depth, in the interest of not breaking anything downstream. However at some point it may make sense to set this to a reasonable value so that recursion depth is limited by default.

dcwatson commented 5 years ago

Thanks, this looks great. I agree a sensible limit is a good idea. I'll probably default it to 100.

I'll push out a release in the next day or two.