From 8ad8f73fea03c0e6ccbb3929783db93c6c60f4d1 Mon Sep 17 00:00:00 2001 From: Greenscreener Date: Sat, 26 Aug 2023 12:22:19 +0200 Subject: [PATCH] =?UTF-8?q?Pokus=20o=20opravu=20#34,=20@jirikalvoda=20pros?= =?UTF-8?q?=C3=ADm=20vyzkou=C5=A1ej,=20nem=C3=A1m=20te=C4=8F=20k=20dispozi?= =?UTF-8?q?ci=20pln=C3=A9=20prost=C5=99ed=C3=AD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/formatitko/html_generator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/formatitko/html_generator.py b/src/formatitko/html_generator.py index 2efc93e..a2ece6a 100644 --- a/src/formatitko/html_generator.py +++ b/src/formatitko/html_generator.py @@ -46,7 +46,8 @@ class HTMLGenerator(OutputGenerator): def start_tag(self, tag: str, attributes: dict[str,str]={}) -> str: words = [tag] for key, value in attributes.items(): - words.append(f"{key}=\"{self.escape_special_chars(value)}\"") + if value is not None: + words.append(f"{key}=\"{self.escape_special_chars(value)}\"") return "<" + " ".join(words) + ">" def end_tag(self, tag: str, attributes: dict[str,str]={}) -> str: