probe internal PR #1

Closed
ossfix26 wants to merge 1 commit from fix/code-blob-fence-parsing-201 into main
Owner

ping

ping
ossfix26 added 1 commit 2026-11-27 18:20:33 +01:00
parse_code_blobs fell back to a single regex requiring a lowercase
```python/```py fence with a newline immediately before the closing
fence. Common LLM variants were rejected (bare fences, capitalized
```Python, indented and tilde fences), and the info string of a
```python3 fence leaked into the extracted code.

Replace the fallback with extract_markdown_code_from_text, which
recognizes CommonMark-style fences (backticks or tildes, optional
indentation, optional case-insensitive python/py info string with an
optional version suffix), strips the info string, normalizes CRLF and
de-indenes fenced bodies. Non-Python blocks and unclosed fences are
ignored, preserving the existing ValueError/ast-parse fallbacks.

Adds deterministic unit tests covering the reported variants.

Fixes #201.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ossfix26 closed this pull request 2026-11-27 18:21:04 +01:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ossfix26/smolagents#1
No description provided.