diff --git a/diagrams/__init__.py b/diagrams/__init__.py index 19b23152..ca84e75c 100644 --- a/diagrams/__init__.py +++ b/diagrams/__init__.py @@ -346,10 +346,12 @@ class Node(_Cluster): icon = self._load_icon() if icon: - self.dot.graph_attr["label"] = '<'\ - ''\ - '
'\ - '' + html.escape(self.label) + '
>' + lines = iter(html.escape(self.label).split("\n")) + self.dot.graph_attr["label"] = '<' +\ + f'' +\ + f'' +\ + ''.join(f'' for line in lines) +\ + '
{next(lines)}
{line}
>' if not self._validate_direction(self._direction): raise ValueError(f'"{self._direction}" is not a valid direction')