MCPcopy Create free account
hub / github.com/kurtmckee/feedparser / handle_entityref

Method handle_entityref

feedparser/html.py:237–248  ·  view source on GitHub ↗

:type ref: str :rtype: None

(self, ref)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected