Represent an image element.
The set_attribute method should be overridden to check if the given key is in the list of accepted attributes.
Represent an image element.
The set_attribute method should be overridden to check if the given key is in the list of accepted attributes.
Create an image leaf node.
def __init__(self, parent: str, identifier: str, src: str):
"""Create an image leaf node.
:param parent: (str) Identifier of the parent node
:param identifier: (str | None) Identifier to assign to the image
:param src: (str) Image source relative path
"""
super(HTMLImage, self).__init__(parent, identifier, 'img')
self.add_attribute('src', src)
self.add_attribute('alt', '')