fix: Handle filenames starting with fence chars in editblock coder

This commit is contained in:
Paul Gauthier 2025-04-20 16:25:54 -07:00 committed by Paul Gauthier (aider)
parent 16fbff8de1
commit 48733a315b

View file

@ -412,7 +412,13 @@ def strip_filename(filename, fence):
return
start_fence = fence[0]
if filename.startswith(start_fence) or filename.startswith(triple_backticks):
if filename.startswith(start_fence):
candidate = filename[len(start_fence):]
if candidate and "." in candidate:
return candidate
if filename.startswith(triple_backticks):
candidate = # ai!
return
filename = filename.rstrip(":")