mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
fix: Refactor all_fences import and add new fence definitions
This commit is contained in:
parent
52ddef9f79
commit
8b1113dd2d
1 changed files with 15 additions and 1 deletions
16
testsr.py
16
testsr.py
|
@ -4,10 +4,24 @@ import json
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from aider.coders.base_coder import all_fences
|
# from aider.coders.base_coder import all_fences
|
||||||
from aider.coders.editblock_coder import find_original_update_blocks
|
from aider.coders.editblock_coder import find_original_update_blocks
|
||||||
|
|
||||||
|
|
||||||
|
def wrap_fence(name):
|
||||||
|
return f"<{name}>", f"</{name}>"
|
||||||
|
|
||||||
|
|
||||||
|
all_fences = [
|
||||||
|
("``" + "`", "``" + "`"),
|
||||||
|
wrap_fence("source"),
|
||||||
|
wrap_fence("code"),
|
||||||
|
wrap_fence("pre"),
|
||||||
|
wrap_fence("codeblock"),
|
||||||
|
wrap_fence("sourcecode"),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def process_markdown(filename):
|
def process_markdown(filename):
|
||||||
try:
|
try:
|
||||||
with open(filename, "r") as file:
|
with open(filename, "r") as file:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue