Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fpdf/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,9 @@ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None
if not self.table or not self.table_row:
raise FPDFException(f"Invalid HTML: <{tag}> used outside any <tr>")
self.td_th = {k.lower(): v for k, v in attrs_dict.items()}
for dimension in ("width", "height"):
if dimension in self.td_th and self.td_th[dimension] is not None:
self.td_th[dimension] = self.td_th[dimension].replace("px", "").strip()
Comment on lines +1128 to +1130
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for dimension in ("width", "height"):
if dimension in self.td_th and self.td_th[dimension] is not None:
self.td_th[dimension] = self.td_th[dimension].replace("px", "").strip()
for dimension in ("width", "height"):
if dimension in self.td_th and self.td_th[dimension] is not None:
self.td_th[dimension] = self.td_th[dimension].replace("px", "").strip()

self.td_th["tag"] = tag
if tag == "th":
if "align" not in self.td_th:
Expand Down
Loading