(self, data)
| 1835 | return j |
| 1836 | |
| 1837 | def feed(self, data): |
| 1838 | data = re.compile(r'<!((?!DOCTYPE|--|\[))', re.IGNORECASE).sub(r'<!\1', data) |
| 1839 | #data = re.sub(r'<(\S+?)\s*?/>', self._shorttag_replace, data) # bug [ 1399464 ] Bad regexp for _shorttag_replace |
| 1840 | data = re.sub(r'<([^<>\s]+?)\s*/>', self._shorttag_replace, data) |
| 1841 | data = data.replace(''', "'") |
| 1842 | data = data.replace('"', '"') |
| 1843 | try: |
| 1844 | bytes |
| 1845 | if bytes is str: |
| 1846 | raise NameError |
| 1847 | self.encoding = self.encoding + '_INVALID_PYTHON_3' |
| 1848 | except NameError: |
| 1849 | if self.encoding and type(data) == type(u''): |
| 1850 | data = data.encode(self.encoding) |
| 1851 | sgmllib.SGMLParser.feed(self, data) |
| 1852 | sgmllib.SGMLParser.close(self) |
| 1853 | |
| 1854 | def normalize_attrs(self, attrs): |
| 1855 | if not attrs: return attrs |
no test coverage detected