MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / is_block_level

Method is_block_level

markdown/core.py:309–320  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 8

handle_starttagMethod · 0.80
open_inline_tagMethod · 0.80
handle_startendtagMethod · 0.80
isblocklevelMethod · 0.80
_prettifyETreeMethod · 0.80
runMethod · 0.80
handle_startendtagMethod · 0.80

Calls

no outgoing calls

Tested by 1