Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Code Block Parser Recursion and Partial Block Detection #753

Draft
wants to merge 1 commit into
base: v2-dev
Choose a base branch
from

Conversation

sam0jones0
Copy link

@sam0jones0 sam0jones0 commented Feb 8, 2025

closes: #752

Fixes issue where parser would enter infinite recursion with certain code block patterns.

  • Anchors code block regex to line start (^) with multiline flag to prevent infinite loops
  • Simplifies partial block detection by checking trimmed match ending
  • Handles indented code blocks with optional whitespace matching
  • Removes dependency on unreliable third capturing group

Copy link

vercel bot commented Feb 8, 2025

@sam0jones0 is attempting to deploy a commit to the Token Fabrics Pro Team on Vercel.

A member of the Team first needs to authorize it.

@sam0jones0 sam0jones0 changed the title fix: prevent recursion in blocks text parser fix: Prevent Recursion in Blocks Text Parser Feb 8, 2025
@sam0jones0 sam0jones0 marked this pull request as ready for review February 8, 2025 12:32
@sam0jones0 sam0jones0 changed the title fix: Prevent Recursion in Blocks Text Parser fix: Code Block Parser Recursion and Partial Block Detection Feb 8, 2025
@sam0jones0 sam0jones0 marked this pull request as draft February 8, 2025 14:04
Copy link

vercel bot commented Feb 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
big-agi-open-next ✅ Ready (Inspect) Visit Preview Feb 8, 2025 8:12pm

@enricoros
Copy link
Owner

Hi @sam0jones0 - is see this is marked as draft, is this well tested and good to review and merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Infinite recursion in blocks text parser
2 participants