(self, i, report=True)
| 385 | # Internal -- parse comment, return length or -1 if not terminated |
| 386 | # see https://html.spec.whatwg.org/multipage/parsing.html#comment-start-state |
| 387 | def parse_comment(self, i, report=True): |
| 388 | rawdata = self.rawdata |
| 389 | assert rawdata.startswith('<!--', i), 'unexpected call to parse_comment()' |
| 390 | match = commentclose.search(rawdata, i+4) |
| 391 | if not match: |
| 392 | match = commentabruptclose.match(rawdata, i+4) |
| 393 | if not match: |
| 394 | return -1 |
| 395 | if report: |
| 396 | j = match.start() |
| 397 | self.handle_comment(rawdata[i+4: j]) |
| 398 | return match.end() |
| 399 | |
| 400 | # Internal -- parse bogus comment, return length or -1 if not terminated |
| 401 | # see https://html.spec.whatwg.org/multipage/parsing.html#bogus-comment-state |
no test coverage detected