diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 22c8d8400..3960515af 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -493,9 +493,10 @@ class Coder: if content is not None: all_content += content + "\n" + lines = all_content.splitlines() good = False for fence_open, fence_close in self.fences: - if fence_open in all_content or fence_close in all_content: + if any(line.startswith(fence_open) or line.startswith(fence_close) for line in lines): continue good = True break