From 51e51ec425f818f4e2def34cf935117ed8f39e82 Mon Sep 17 00:00:00 2001 From: Greenscreener Date: Fri, 21 Jul 2023 15:01:01 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20chyby=20z=20fe63458a51,=20generate=5Fsimp?= =?UTF-8?q?le=5Ftag=20=C5=A1patn=C4=9B=20propagoval=20atributy.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/formatitko/output_generator.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/formatitko/output_generator.py b/src/formatitko/output_generator.py index b1ef03f..7abdcd2 100644 --- a/src/formatitko/output_generator.py +++ b/src/formatitko/output_generator.py @@ -156,10 +156,11 @@ class OutputGenerator: def generate_simple_tag(self, e: Union[Element, None]=None, tag: str="", attributes: Union[dict[str,str],None]=None, content: Union[ListContainer, Element, list[Union[Element, ListContainer]], str, None]=None, inline: Union[bool, None]=None): if not tag and e: tag = self.tagname(e) - if attributes is None and e: - attributes = self.common_attributes(e) - else: - attributes = {} + if attributes is None: + if e: + attributes = self.common_attributes(e) + else: + attributes = {} if content is None and e and hasattr(e, "content"): content = e.content if content is None and e and hasattr(e, "text"):