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

Method __init__

markdown/extensions/md_in_html.py:43–57  ·  view source on GitHub ↗
(self, md: Markdown, *args, **kwargs)

Source from the content-addressed store, hash-verified

41 """
42
43 def __init__(self, md: Markdown, *args, **kwargs):
44 # All block-level tags.
45 self.block_level_tags = set(md.block_level_elements.copy())
46 # Block-level tags in which the content only gets span level parsing
47 self.span_tags = set(
48 ['address', 'dd', 'dt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'legend', 'li', 'p', 'summary', 'td', 'th']
49 )
50 # Block-level tags which never get their content parsed.
51 self.raw_tags = set(['canvas', 'math', 'option', 'pre', 'script', 'style', 'textarea'])
52
53 super().__init__(md, *args, **kwargs)
54
55 # Block-level tags in which the content gets parsed as blocks
56 self.block_tags = set(self.block_level_tags) - (self.span_tags | self.raw_tags | self.empty_tags)
57 self.span_and_blocks_tags = self.block_tags | self.span_tags
58
59 def reset(self):
60 """Reset this instance. Loses all unprocessed data."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected