Check if the given `tag` is a block level HTML tag. Returns `True` for any string listed in `Markdown.block_level_elements`. A `tag` which is not a string always returns `False`.
(self, tag: Any)
| 300 | # Note: the `tag` argument is type annotated `Any` as ElementTree uses many various objects as tags. |
| 301 | # As there is no standardization in ElementTree, the type of a given tag is unpredictable. |
| 302 | def is_block_level(self, tag: Any) -> bool: |
| 303 | """ |
| 304 | Check if the given `tag` is a block level HTML tag. |
| 305 | |
| 306 | Returns `True` for any string listed in `Markdown.block_level_elements`. A `tag` which is |
| 307 | not a string always returns `False`. |
| 308 | |
| 309 | """ |
| 310 | if isinstance(tag, str): |
| 311 | return tag.lower().rstrip('/') in self.block_level_elements |
| 312 | # Some ElementTree tags are not strings, so return False. |
| 313 | return False |
| 314 | |
| 315 | def convert(self, source: str) -> str: |
| 316 | """ |
no outgoing calls