Represent a horizontal line with <hr> tag.
The <hr> tag only supports the Global Attributes in HTML.
Represent a horizontal line with <hr> tag.
The <hr> tag only supports the Global Attributes in HTML.
Create a node for <hr> tag.
def __init__(self, parent: str):
"""Create a node for <hr> tag.
"""
super(HTMLHr, self).__init__(parent, None, 'hr')
Override.
def check_attribute(self, key: str) -> str:
"""Override.
:return: key (str)
:raises: NodeAttributeError: if given key can't be converted to string
:raises: NodeAttributeError: The attribute can't be assigned to this element.
"""
try:
key = str(key)
except Exception:
raise NodeAttributeError(key)
if key not in HTML_GLOBAL_ATTR and key.startswith('data-') is False:
raise NodeAttributeError(key)
return key