You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/hyperkitty/templatetags/decorate.py", line 36, in render
return mark_safe(text_renderer(content))
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/markdown.py", line 110, in __call__
return self.parse(s)[0]
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/markdown.py", line 85, in parse
self.block.parse(state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 446, in parse
end_pos = self.parse_method(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/core.py", line 168, in parse_method
return func(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 369, in parse_block_quote
self.parse(child, rules)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 446, in parse
end_pos = self.parse_method(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/core.py", line 168, in parse_method
return func(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 369, in parse_block_quote
self.parse(child, rules)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 446, in parse
end_pos = self.parse_method(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/core.py", line 168, in parse_method
return func(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 369, in parse_block_quote
self.parse(child, rules)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 446, in parse
end_pos = self.parse_method(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/core.py", line 168, in parse_method
return func(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 369, in parse_block_quote
self.parse(child, rules)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 446, in parse
end_pos = self.parse_method(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/core.py", line 168, in parse_method
return func(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 369, in parse_block_quote
self.parse(child, rules)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 446, in parse
end_pos = self.parse_method(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/core.py", line 168, in parse_method
return func(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 369, in parse_block_quote
self.parse(child, rules)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/block_parser.py", line 446, in parse
end_pos = self.parse_method(m, state)
File "/opt/mailman/mm/venv/lib/python3.9/site-packages/mistune/core.py", line 167, in parse_method
func = self._methods[m.lastgroup]
KeyError: None
The text was updated successfully, but these errors were encountered:
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.
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)
The text was updated successfully, but these errors were encountered: