Open maxking opened 10 months ago
My suspicion is that after 5 levels of parsing blockquote, the block.block_quote_rules
removes block_quote
so that becomes an empty set of rules []
. And since there aren't any rules m.lastgroup
has no groups so it returns None
value causing the above exception.
IMO, this can be guarded against with a None check of try-except
(so control flow is altered only in case of special case of block_quote_rules
being empty, which isn't typical).
Happy to submit a patch a try-except to guard works.
@maxking A pull request is welcome.
We have a custom plugin that we use to disable all the parsing rules, except
block_quote
. The way we have implemented this is:This causes an exception in the situation when the block_quote nesting depth increases the max_nesting_depth value (6 is the default in mistune).
So, a text like:
will raise an exception like below (few lines of traceback is removed, full traceback can be found here)