Skip to content

Commit 6c8c920

Browse files
Copilotcommjoen
andcommitted
Fix Black formatting issues in Python script
Co-authored-by: commjoen <[email protected]>
1 parent dfd320c commit 6c8c920

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

.github/scripts/generate_thymeleaf_previews.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -135,46 +135,48 @@ def convert_adoc_to_html(self, adoc_content):
135135
html = adoc_content
136136

137137
# Convert headers
138-
html = re.sub(r'^=== (.+)$', r'<h3>\1</h3>', html, flags=re.MULTILINE)
139-
html = re.sub(r'^== (.+)$', r'<h2>\1</h2>', html, flags=re.MULTILINE)
140-
html = re.sub(r'^= (.+)$', r'<h1>\1</h1>', html, flags=re.MULTILINE)
138+
html = re.sub(r"^=== (.+)$", r"<h3>\1</h3>", html, flags=re.MULTILINE)
139+
html = re.sub(r"^== (.+)$", r"<h2>\1</h2>", html, flags=re.MULTILINE)
140+
html = re.sub(r"^= (.+)$", r"<h1>\1</h1>", html, flags=re.MULTILINE)
141141

142142
# Convert bold text
143-
html = re.sub(r'\*\*([^*]+)\*\*', r'<strong>\1</strong>', html)
143+
html = re.sub(r"\*\*([^*]+)\*\*", r"<strong>\1</strong>", html)
144144

145145
# Convert lists
146-
lines = html.split('\n')
146+
lines = html.split("\n")
147147
html_lines = []
148148
in_list = False
149149

150150
for line in lines:
151-
if line.strip().startswith('- '):
151+
if line.strip().startswith("- "):
152152
if not in_list:
153-
html_lines.append('<ul>')
153+
html_lines.append("<ul>")
154154
in_list = True
155155
list_item = line.strip()[2:] # Remove '- '
156-
html_lines.append(f'<li>{list_item}</li>')
157-
elif line.strip().startswith('. '):
156+
html_lines.append(f"<li>{list_item}</li>")
157+
elif line.strip().startswith(". "):
158158
if not in_list:
159-
html_lines.append('<ol>')
159+
html_lines.append("<ol>")
160160
in_list = True
161161
list_item = line.strip()[2:] # Remove '. '
162-
html_lines.append(f'<li>{list_item}</li>')
162+
html_lines.append(f"<li>{list_item}</li>")
163163
else:
164164
if in_list:
165-
html_lines.append('</ul>' if html_lines[-1].startswith('<li>') else '</ol>')
165+
html_lines.append(
166+
"</ul>" if html_lines[-1].startswith("<li>") else "</ol>"
167+
)
166168
in_list = False
167169

168170
# Convert paragraphs
169171
if line.strip():
170-
html_lines.append(f'<p>{line.strip()}</p>')
172+
html_lines.append(f"<p>{line.strip()}</p>")
171173
else:
172-
html_lines.append('')
174+
html_lines.append("")
173175

174176
if in_list:
175-
html_lines.append('</ul>')
177+
html_lines.append("</ul>")
176178

177-
return '\n'.join(html_lines)
179+
return "\n".join(html_lines)
178180

179181
def generate_mock_challenges(self):
180182
"""Generate mock challenge data."""

0 commit comments

Comments
 (0)