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

Method handle_comment

markdown/htmlparser.py:334–339  ·  view source on GitHub ↗
(self, data: str)

Source from the content-addressed store, hash-verified

332 self.handle_empty_tag('&{};'.format(name), is_block=False)
333
334 def handle_comment(self, data: str):
335 # Check if the comment is unclosed, if so, we need to override position
336 text = '<!--{}-->'.format(data)
337 # A comment inside a raw inline element is part of that inline content, unless it contains a blank line.
338 is_block = bool(inner_blank_line_re.search(data)) or not self.inline_close_follows(text)
339 self.handle_empty_tag(text, is_block=is_block)
340
341 def handle_decl(self, data: str):
342 self.handle_empty_tag('<!{}>'.format(data), is_block=True)

Callers 1

parse_commentMethod · 0.95

Calls 3

inline_close_followsMethod · 0.95
handle_empty_tagMethod · 0.95
searchMethod · 0.80

Tested by

no test coverage detected