(data, encoding)
| 250 | return re.sub(r"&#?[A-Za-z0-9]+?;", replace_entities, data) |
| 251 | |
| 252 | def unescape_charref(data, encoding): |
| 253 | name, base = data, 10 |
| 254 | if name.startswith("x"): |
| 255 | name, base= name[1:], 16 |
| 256 | elif not name.isdigit(): |
| 257 | base = 16 |
| 258 | |
| 259 | try: |
| 260 | return _unichr(int(name, base)) |
| 261 | except: |
| 262 | return data |
| 263 | |
| 264 | def get_entitydefs(): |
| 265 | from codecs import latin_1_decode |
no outgoing calls
no test coverage detected
searching dependent graphs…