diff --git a/tools/render_card.py b/tools/render_card.py
index 95f6143..05063dc 100644
--- a/tools/render_card.py
+++ b/tools/render_card.py
@@ -3061,7 +3061,7 @@ def render_observation_5a_html(data: dict, section_number: int = 14) -> str:
rows = []
for row in obs.get("rows", []):
cells = row.get("cells", [])
- rows.append("".join(f"
{html_escape(text_5a(cell)) if cell else ''} | " for cell in cells))
+ rows.append("".join(f"{html_or_write_box(cell, 'write-box')} | " for cell in cells))
table = f'{headers}
' + "".join(f"{row}
" for row in rows) + "
"
return section_box_5a_html(section_number, obs.get("title", "Karta obserwacji"), table, "dense")
@@ -3072,7 +3072,7 @@ def render_troubleshooting_5a_html(data: dict, section_number: int = 15) -> str:
f'{html_escape(text_5a(row.get("symptom", "")))} | '
f'{html_escape(text_5a(row.get("hypothesis", "")))} | '
f'{html_escape(text_5a(row.get("action", "")))} | '
- f'{html_escape(text_5a(row.get("result", ""))) if row.get("result") else ""} | '
+ f'{html_or_write_box(row.get("result", ""), "write-box small")} | '
''
for row in data.get("troubleshooting", [])
)
@@ -3080,6 +3080,12 @@ def render_troubleshooting_5a_html(data: dict, section_number: int = 15) -> str:
return section_box_5a_html(section_number, "Troubleshooting log", table, "dense")
+def html_or_write_box(value: object, class_name: str) -> str:
+ if value:
+ return html_escape(text_5a(value))
+ return f''
+
+
def render_analysis_5a_html(data: dict, section_number: int = 16, line_count: int = 3) -> str:
answer_lines = "".join("" for _ in range(line_count))
items = "".join(