(self, i, report=1)
| 163 | |
| 164 | # Internal -- parse comment, return length or -1 if not terminated |
| 165 | def parse_comment(self, i, report=1): |
| 166 | rawdata = self.rawdata |
| 167 | if rawdata[i:i+4] != '<!--': |
| 168 | raise AssertionError('unexpected call to parse_comment()') |
| 169 | match = _commentclose.search(rawdata, i+4) |
| 170 | if not match: |
| 171 | return -1 |
| 172 | if report: |
| 173 | j = match.start(0) |
| 174 | self.handle_comment(rawdata[i+4: j]) |
| 175 | return match.end(0) |
| 176 | |
| 177 | # Internal -- scan past the internal subset in a <!DOCTYPE declaration, |
| 178 | # returning the index just past any whitespace following the trailing ']'. |
no test coverage detected