We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d8d94f commit 8236c66Copy full SHA for 8236c66
pyhtml/__tag_base.py
@@ -158,10 +158,14 @@ def _render(self) -> list[str]:
158
Renders tag and its children to a list of strings where each string is
159
a single line of output
160
"""
161
- if len(self.attributes):
+ attributes = util.filter_attributes(util.dict_union(
162
+ self._get_default_attributes(),
163
+ self.attributes,
164
+ ))
165
+ if len(attributes):
166
return [
167
f"<{self._get_tag_name()} "
- f"{util.render_tag_attributes(self.attributes)}/>"
168
+ f"{util.render_tag_attributes(attributes)}/>"
169
]
170
else:
171
return [f"<{self._get_tag_name()}/>"]
0 commit comments