mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
refactor: Optimize if section.strip()
condition
This commit is contained in:
parent
9463639228
commit
d8e5f4fdec
1 changed files with 8 additions and 7 deletions
15
testsr.py
15
testsr.py
|
@ -16,14 +16,15 @@ def process_markdown(filename):
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
for section in sections:
|
for section in sections:
|
||||||
if section.strip(): # Ignore empty sections
|
if not section.strip(): # Ignore empty sections
|
||||||
# Extract the header (if present)
|
continue
|
||||||
header = section.split("\n")[0].strip()
|
# Extract the header (if present)
|
||||||
# Get the content (everything after the header)
|
header = section.split("\n")[0].strip()
|
||||||
content = "\n".join(section.split("\n")[1:]).strip()
|
# Get the content (everything after the header)
|
||||||
|
content = "\n".join(section.split("\n")[1:]).strip()
|
||||||
|
|
||||||
# Process the content with find_original_update_blocks
|
# Process the content with find_original_update_blocks
|
||||||
try:
|
try:
|
||||||
blocks = list(find_original_update_blocks(content, DEFAULT_FENCE))
|
blocks = list(find_original_update_blocks(content, DEFAULT_FENCE))
|
||||||
|
|
||||||
# Create a dictionary for this section
|
# Create a dictionary for this section
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue