mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 04:14:59 +00:00
style: Remove trailing whitespace
This commit is contained in:
parent
83c599e741
commit
2d3162a90b
1 changed files with 15 additions and 14 deletions
|
@ -425,7 +425,7 @@ def get_testimonials_js():
|
|||
try:
|
||||
with open(readme_path, "r", encoding="utf-8") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
|
||||
# Find the testimonials section
|
||||
for i, line in enumerate(lines):
|
||||
if line.strip() == "## Kind Words From Users":
|
||||
|
@ -433,7 +433,7 @@ def get_testimonials_js():
|
|||
# Start processing from the next line
|
||||
start_idx = i + 1
|
||||
break
|
||||
|
||||
|
||||
# If we found the section
|
||||
if in_testimonials_section:
|
||||
for i in range(start_idx, len(lines)):
|
||||
|
@ -441,29 +441,29 @@ def get_testimonials_js():
|
|||
# If we've hit another section, stop
|
||||
if line.startswith("##"):
|
||||
break
|
||||
|
||||
|
||||
# Process testimonial lines
|
||||
if line.strip().startswith('- *"'):
|
||||
try:
|
||||
# Get the full line
|
||||
full_line = line.strip()
|
||||
|
||||
|
||||
# Extract the quote text between *" and "*
|
||||
if '*"' in full_line and '"*' in full_line:
|
||||
quote_parts = full_line.split('*"')
|
||||
if len(quote_parts) > 1:
|
||||
quote_text = quote_parts[1].split('"*')[0].strip()
|
||||
|
||||
|
||||
# Default values
|
||||
author = "Anonymous"
|
||||
link = ""
|
||||
|
||||
|
||||
# Try to extract author and link if they exist
|
||||
if "— [" in full_line and "](" in full_line:
|
||||
author_parts = full_line.split("— [")
|
||||
if len(author_parts) > 1:
|
||||
author = author_parts[1].split("]")[0].strip()
|
||||
|
||||
|
||||
# Extract the link if it exists
|
||||
link_parts = full_line.split("](")
|
||||
if len(link_parts) > 1:
|
||||
|
@ -473,14 +473,15 @@ def get_testimonials_js():
|
|||
author_parts = full_line.split("— ")
|
||||
if len(author_parts) > 1:
|
||||
author = author_parts[1].strip()
|
||||
|
||||
testimonials.append({
|
||||
"text": quote_text,
|
||||
"author": author,
|
||||
"link": link
|
||||
})
|
||||
|
||||
testimonials.append(
|
||||
{"text": quote_text, "author": author, "link": link}
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"Error parsing testimonial line: {line}. Error: {e}", file=sys.stderr)
|
||||
print(
|
||||
f"Error parsing testimonial line: {line}. Error: {e}",
|
||||
file=sys.stderr,
|
||||
)
|
||||
continue
|
||||
|
||||
# Format as JavaScript array with script tags
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue