From 44cc62b922847c743c002ad810192b0a77b7732f Mon Sep 17 00:00:00 2001 From: Hsiaoming Yang Date: Sat, 30 Sep 2023 08:49:36 +0900 Subject: [PATCH] fix: fix RecursionError for lists ref: https://github.com/lepture/mistune/issues/356 --- src/mistune/list_parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mistune/list_parser.py b/src/mistune/list_parser.py index b5ff866..6ce6baa 100644 --- a/src/mistune/list_parser.py +++ b/src/mistune/list_parser.py @@ -146,6 +146,10 @@ def _parse_list_item(block, bullet, groups, token, state, rules): ) state.cursor = m.end() + 1 break + + if tok_type == 'list': + break + tok_index = len(state.tokens) end_pos = block.parse_method(m, state) if end_pos: