From 7c9cff2f6ecea9b68cced7d446086a7e79c70c04 Mon Sep 17 00:00:00 2001 From: "Mathis Beer (aider)" Date: Tue, 24 Jun 2025 10:20:38 +0200 Subject: [PATCH] refactor: update HEAD regex to accept optional closing tag in search blocks When working with HTML text, the network has a strong bias to go "well, this is '<' followed by text, it's a tag! I should close it with '>'." Then the edit would be ignored. --- aider/coders/editblock_coder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index d8f85da52..37d40d97c 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -383,7 +383,7 @@ def do_replace(fname, content, before_text, after_text, fence=None): return new_content -HEAD = r"^<{5,9} SEARCH\s*$" +HEAD = r"^<{5,9} SEARCH>?\s*$" DIVIDER = r"^={5,9}\s*$" UPDATED = r"^>{5,9} REPLACE\s*$"