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