Treat a bogus SGML declaration as raw data. Treat a CDATA declaration as a CData object.
(self, i)
| 1448 | self._toStringSubclass(data, Declaration) |
| 1449 | |
| 1450 | def parse_declaration(self, i): |
| 1451 | """Treat a bogus SGML declaration as raw data. Treat a CDATA |
| 1452 | declaration as a CData object.""" |
| 1453 | j = None |
| 1454 | if self.rawdata[i:i+9] == '<![CDATA[': |
| 1455 | k = self.rawdata.find(']]>', i) |
| 1456 | if k == -1: |
| 1457 | k = len(self.rawdata) |
| 1458 | data = self.rawdata[i+9:k] |
| 1459 | j = k+3 |
| 1460 | self._toStringSubclass(data, CData) |
| 1461 | else: |
| 1462 | try: |
| 1463 | j = SGMLParser.parse_declaration(self, i) |
| 1464 | except SGMLParseError: |
| 1465 | toHandle = self.rawdata[i:] |
| 1466 | self.handle_data(toHandle) |
| 1467 | j = i + len(toHandle) |
| 1468 | return j |
| 1469 | |
| 1470 | class BeautifulSoup(BeautifulStoneSoup): |
| 1471 |
nothing calls this directly
no test coverage detected