Skip to content

Commit 40e3af4

Browse files
committed
Improve rendering of briefs
1 parent 1f0fb23 commit 40e3af4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

pointblank/validate.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8764,7 +8764,15 @@ def _transform_assertion_str(
87648764
# Declare the text size based on the length of `assertion_str`
87658765
text_size = [10 if nchar + 2 >= 20 else 11 for nchar in assertion_type_nchar]
87668766

8767-
# Create the assertion type update using a list comprehension
8767+
# Define the brief's HTML div tag for each row
8768+
brief_divs = [
8769+
f"<div style=\"font-size: 9px; font-family: 'IBM Plex Sans'; text-wrap: balance; margin-top: 3px;\">{brief}</div>"
8770+
if brief.strip()
8771+
else ""
8772+
for brief in brief_str
8773+
]
8774+
8775+
# Create the assertion `type_upd` strings
87688776
type_upd = [
87698777
f"""
87708778
<div style="margin: 0; padding: 0; display: inline-block; height: 30px; vertical-align: middle; width: 16%;">
@@ -8773,9 +8781,9 @@ def _transform_assertion_str(
87738781
<div style="font-family: 'IBM Plex Mono', monospace, courier; color: black; font-size: {size}px; display: inline-block; vertical-align: middle;">
87748782
<div>{assertion}</div>
87758783
</div>
8776-
<div style="font-size: 9px; font-family: 'IBM Plex Sans'; text-wrap: balance; margin-top: 3px;">{brief}</div>
8784+
{brief_div}
87778785
"""
8778-
for assertion, svg, size, brief in zip(assertion_str, svg_icon, text_size, brief_str)
8786+
for assertion, svg, size, brief_div in zip(assertion_str, svg_icon, text_size, brief_divs)
87798787
]
87808788

87818789
return type_upd

0 commit comments

Comments
 (0)