Skip to content

Conversation

shulaoda
Copy link

@shulaoda shulaoda commented Oct 8, 2025

closes #6660

Previously, when formatting comments containing blockquotes followed by comparison operators like > >= >> >>= >>> >>>=, the code would panic with byte index out of bounds error.

The issue was in itemized_block_quote_start function, which counted all > characters in non-alphanumeric prefix, treating operators like >= as nested blockquote markers. This caused the calculated indent to exceed the line length, leading to out-of-bounds indexing.

Fixed by only recognizing valid Markdown blockquote syntax where each > must be followed by a space (e.g., > > text), which was the original intended behavior. Note that only the standard format with spaces is supported, alternative formats like >> text, > > text (multiple spaces), or >text (no space) are not recognized as blockquote markers.

@shulaoda shulaoda marked this pull request as draft October 9, 2025 02:20
@shulaoda shulaoda marked this pull request as ready for review October 9, 2025 03:55
@shulaoda shulaoda requested a review from Manishearth October 9, 2025 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE with wrap_comments = true
3 participants