mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
fix: Handle errors in processing Markdown sections
This commit is contained in:
parent
8ec67d339d
commit
882cf676b9
1 changed files with 5 additions and 4 deletions
|
@ -33,7 +33,6 @@ def process_markdown(filename):
|
|||
# Split the content into sections based on '####' headers
|
||||
sections = re.split(r"(?=####\s)", content)
|
||||
|
||||
results = []
|
||||
for section in sections:
|
||||
if "editblock_coder.py" in section or "test_editblock.py" in section:
|
||||
continue
|
||||
|
@ -53,10 +52,13 @@ def process_markdown(filename):
|
|||
try:
|
||||
blocks = list(find_original_update_blocks(content, fence))
|
||||
except ValueError as e:
|
||||
# If an error occurs, add it to the results for this section
|
||||
results.append({"header": header, "error": str(e)})
|
||||
print("***", header, "*" * 20)
|
||||
print(str(e))
|
||||
continue
|
||||
|
||||
if blocks:
|
||||
print("***", header, "*" * 20)
|
||||
|
||||
for block in blocks:
|
||||
if block[0] is None: # This is a shell command block
|
||||
print("*** SHELL", "*" * 20)
|
||||
|
@ -65,7 +67,6 @@ def process_markdown(filename):
|
|||
|
||||
else: # This is a SEARCH/REPLACE block
|
||||
print("*** SEARCH:", block[0], "*" * 20)
|
||||
print("***", header, "*" * 20)
|
||||
print(block[1], end="")
|
||||
print("*" * 20)
|
||||
print(block[2], end="")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue