From e1997b293935ecf40652b944bde9738f152352fc Mon Sep 17 00:00:00 2001 From: algosul <2283106661@qq.com> Date: Wed, 9 Jul 2025 20:57:01 +0800 Subject: [PATCH] fix (#6586): Set a length limit see #6586 --- src/comment.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/comment.rs b/src/comment.rs index 709031dda44..963c12386e1 100644 --- a/src/comment.rs +++ b/src/comment.rs @@ -497,7 +497,7 @@ impl ItemizedBlock { // of the new line_start. We update the indent because it effects the max width // of each formatted line. line_start = itemized_block_quote_start(line, line_start, 2); - indent = line_start.len(); + indent = line_start.len().min(line.len()); } Some(ItemizedBlock { lines: vec![line[indent..].to_string()],