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