(self, i: int)
| 331 | return match.end() |
| 332 | |
| 333 | def parse_html_declaration(self, i: int) -> int: |
| 334 | if self.at_line_start() or self.intail: |
| 335 | if self.rawdata[i:i+3] == '<![' and not self.rawdata[i:i+9] == '<![CDATA[': |
| 336 | # We have encountered the bug in #1534 (Python bug `gh-77057`). |
| 337 | # Provide an override until we drop support for Python < 3.13. |
| 338 | result = self.parse_bogus_comment(i) |
| 339 | if result == -1: |
| 340 | self.handle_data(self.rawdata[i:i + 1]) |
| 341 | return i + 1 |
| 342 | return result |
| 343 | return super().parse_html_declaration(i) |
| 344 | # This is not the beginning of a raw block so treat as plain data |
| 345 | # and avoid consuming any tags which may follow (see #1066). |
| 346 | self.handle_data('<!') |
| 347 | return i + 2 |
| 348 | |
| 349 | def parse_bogus_comment(self, i: int, report: int = 0) -> int: |
| 350 | # Override the default behavior so that bogus comments get passed |
nothing calls this directly
no test coverage detected