mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
fix: Handle filenames starting with fences or triple backticks correctly
This commit is contained in:
parent
c6ce871700
commit
5e210c700d
2 changed files with 16 additions and 37 deletions
|
@ -414,11 +414,15 @@ def strip_filename(filename, fence):
|
|||
start_fence = fence[0]
|
||||
if filename.startswith(start_fence):
|
||||
candidate = filename[len(start_fence) :]
|
||||
if candidate and "." in candidate:
|
||||
if candidate and ("." in candidate or "/" in candidate):
|
||||
return candidate
|
||||
return
|
||||
|
||||
if filename.startswith(triple_backticks):
|
||||
filename = filename[len(triple_backticks) :]
|
||||
candidate = filename[len(triple_backticks) :]
|
||||
if candidate and ("." in candidate or "/" in candidate):
|
||||
return candidate
|
||||
return
|
||||
|
||||
filename = filename.rstrip(":")
|
||||
filename = filename.lstrip("#")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue