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.
This commit is contained in:
Mathis Beer (aider) 2025-06-24 10:20:38 +02:00 committed by Mathis Beer
parent f9fc2c6a44
commit 7c9cff2f6e

View file

@ -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*$"