refactor: Optimize if section.strip() condition

This commit is contained in:
Paul Gauthier (aider) 2024-08-22 08:18:27 -07:00
parent 9463639228
commit d8e5f4fdec

View file

@ -16,7 +16,8 @@ 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
continue
# Extract the header (if present) # Extract the header (if present)
header = section.split("\n")[0].strip() header = section.split("\n")[0].strip()
# Get the content (everything after the header) # Get the content (everything after the header)