MCPcopy Index your code
hub / github.com/Python-Markdown/markdown / parse_comment

Method parse_comment

markdown/htmlparser.py:321–331  ·  view source on GitHub ↗
(self, i, report=True)

Source from the content-addressed store, hash-verified

319 # Internal -- parse comment, return length or -1 if not terminated
320 # see https://html.spec.whatwg.org/multipage/parsing.html#comment-start-state
321 def parse_comment(self, i, report=True):
322 rawdata = self.rawdata
323 assert rawdata.startswith('<!--', i), 'unexpected call to parse_comment()'
324 match = commentclose.search(rawdata, i+4)
325 if not match:
326 self.handle_data('<')
327 return i + 1
328 if report:
329 j = match.start()
330 self.handle_comment(rawdata[i+4: j])
331 return match.end()
332
333 def parse_html_declaration(self, i: int) -> int:
334 if self.at_line_start() or self.intail:

Callers

nothing calls this directly

Calls 2

handle_dataMethod · 0.95
handle_commentMethod · 0.95

Tested by

no test coverage detected