mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 19:24:59 +00:00
refactor: Simplify fence pattern matching in base_coder.py
This commit is contained in:
parent
7611211d1c
commit
38678fafc1
1 changed files with 3 additions and 2 deletions
|
@ -59,7 +59,8 @@ def wrap_fence(name):
|
||||||
|
|
||||||
|
|
||||||
all_fences = [
|
all_fences = [
|
||||||
("``" + "`", "``" + "`"),
|
("`" * 3, "`" * 3),
|
||||||
|
("`" * 4, "`" * 4),
|
||||||
wrap_fence("source"),
|
wrap_fence("source"),
|
||||||
wrap_fence("code"),
|
wrap_fence("code"),
|
||||||
wrap_fence("pre"),
|
wrap_fence("pre"),
|
||||||
|
@ -520,7 +521,7 @@ class Coder:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# only show pretty output if fences are the normal triple-backtick
|
# only show pretty output if fences are the normal triple-backtick
|
||||||
if self.fence != self.fences[0]:
|
if self.fence[0][0] != "`":
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue