:type ref: str :rtype: None
(self, ref)
| 235 | self.pieces.append('&#%s;' % ref) |
| 236 | |
| 237 | def handle_entityref(self, ref): |
| 238 | """ |
| 239 | :type ref: str |
| 240 | :rtype: None |
| 241 | """ |
| 242 | |
| 243 | # Called for each entity reference, e.g. '©' will extract 'copy' |
| 244 | # Reconstruct the original entity reference. |
| 245 | if ref in html.entities.name2codepoint or ref == 'apos': |
| 246 | self.pieces.append('&%s;' % ref) |
| 247 | else: |
| 248 | self.pieces.append('&%s' % ref) |
| 249 | |
| 250 | def handle_data(self, text): |
| 251 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected