Pokus o opravu #34, @jirikalvoda prosím vyzkoušej, nemám teď k dispozici plné prostředí.

This commit is contained in:
Jan Černohorský 2023-08-26 12:22:19 +02:00
parent c1430069ab
commit 8ad8f73fea

View file

@ -46,7 +46,8 @@ class HTMLGenerator(OutputGenerator):
def start_tag(self, tag: str, attributes: dict[str,str]={}) -> str: def start_tag(self, tag: str, attributes: dict[str,str]={}) -> str:
words = [tag] words = [tag]
for key, value in attributes.items(): 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) + ">" return "<" + " ".join(words) + ">"
def end_tag(self, tag: str, attributes: dict[str,str]={}) -> str: def end_tag(self, tag: str, attributes: dict[str,str]={}) -> str: