(self, i: int)
| 378 | return match.end() |
| 379 | |
| 380 | def parse_html_declaration(self, i: int) -> int: |
| 381 | if self.at_line_start() or self.intail: |
| 382 | if self.rawdata[i:i+3] == '<![' and not self.rawdata[i:i+9] == '<![CDATA[': |
| 383 | # We have encountered the bug in #1534 (Python bug `gh-77057`). |
| 384 | # Provide an override until we drop support for Python < 3.13. |
| 385 | result = self.parse_bogus_comment(i) |
| 386 | if result == -1: |
| 387 | self.handle_data(self.rawdata[i:i + 1]) |
| 388 | return i + 1 |
| 389 | return result |
| 390 | return super().parse_html_declaration(i) |
| 391 | # This is not the beginning of a raw block so treat as plain data |
| 392 | # and avoid consuming any tags which may follow (see #1066). |
| 393 | self.handle_data('<!') |
| 394 | return i + 2 |
| 395 | |
| 396 | def parse_bogus_comment(self, i: int, report: int = 0) -> int: |
| 397 | # Override the default behavior so that bogus comments get passed |
nothing calls this directly
no test coverage detected