fix: Remove unnecessary checks and simplify content extraction in process_markdown function

This commit is contained in:
Paul Gauthier 2024-08-22 08:46:50 -07:00 committed by Paul Gauthier (aider)
parent 1d6bdfce80
commit 52ddef9f79

View file

@ -21,15 +21,15 @@ def process_markdown(filename):
results = []
for section in sections:
if "editblock_coder.py" in section or "test_editblock.py" in section:
continue
if not section.strip(): # Ignore empty sections
continue
# Extract the header (if present)
header = section.split("\n")[0].strip()
# Get the content (everything after the header)
content = "\n".join(section.split("\n")[1:]).strip()
if "editblock" in content:
continue
content = "".join(section.splitlines(keepends=True)[1:])
for fence in all_fences:
if "\n" + fence[0] in content: