Skip to content

Commit

Permalink
fix(model): Don't show an empty box if there's no icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuestengecko committed May 24, 2024
1 parent e3b542d commit f523bc9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions capellambse/model/common/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,15 @@ def __html__(self) -> markupsafe.Markup:
escape = markupsafe.Markup.escape

try:
icon = self._get_icon("datauri_svg", size=20) or ""
icon = self._get_icon("datauri_svg", size=20)
except Exception:
icon = ""
else:
icon = f'<img src="{icon}" alt="" width="20" height="20"> '
icon = None

fragments.append("<h1>")
fragments.append(icon)
if icon:
fragments.append(
f'<img src="{icon}" alt="" width="20" height="20"> '
)
# pylint: disable-next=unidiomatic-typecheck
if type(self) is GenericElement:
fragments.append("Model element")
Expand Down

0 comments on commit f523bc9

Please sign in to comment.