From 2e36f104edef095d85bd610d4b271072c17e1a5f Mon Sep 17 00:00:00 2001 From: John Baublitz Date: Sat, 30 Nov 2024 00:29:09 -0500 Subject: [PATCH] Fix chart format bug --- language_practice/web/shared.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/language_practice/web/shared.py b/language_practice/web/shared.py index 481e07c..120ef19 100644 --- a/language_practice/web/shared.py +++ b/language_practice/web/shared.py @@ -18,6 +18,10 @@ def uk_ru_tables(tables: list[Any], remove: str) -> list[list[list[str]]]: for tr in table.find_all("tr") if [entry.text.strip() for entry in tr.find_all("td")] != [] ] + max_len = max(map(len, chart)) + for chart_line in chart: + for _ in range(0, max_len - len(chart_line)): + chart_line.insert(1, "") charts.append(chart)