fix(api): Code formatting

This commit is contained in:
AaronBenDaniel
2025-06-10 11:06:23 -04:00
parent 1db3f82f15
commit 6e93f743f3
2 changed files with 9 additions and 7 deletions
+8 -6
View File
@@ -111,9 +111,9 @@ class PDFGenerator(AbstractGenerator):
if not img_data:
continue
img_tag[
"src"
] = f"data:image/jpg;base64,{b64encode(img_data).decode()}"
img_tag["src"] = (
f"data:image/jpg;base64,{b64encode(img_data).decode()}"
)
data[part["id"]] = tree.prettify()
@@ -137,9 +137,11 @@ class PDFGenerator(AbstractGenerator):
"description": self.story["description"],
"avatar": b64encode(self.author).decode(),
"copyright": {
"data": b64encode(copyright["asset"].read_bytes()).decode()
if copyright["asset"]
else "",
"data": (
b64encode(copyright["asset"].read_bytes()).decode()
if copyright["asset"]
else ""
),
"name": copyright["name"],
},
"parts": parts,
+1 -1
View File
@@ -31,7 +31,7 @@ def clean_tree(title: str, id: int, body: str) -> BeautifulSoup:
for child in cast(list[Tag], tag.children):
# tag is a <p> enclosing either text, media, or a break
if child.name in [None, "b", "i", "u","strong","em"]:
if child.name in [None, "b", "i", "u", "strong", "em"]:
# text is enclosed, can be italic, bold, underlined, or a mix
tag.attrs = {}
p_tag = tag