MCPcopy Index your code
hub / github.com/aaronsw/html2text / entityref

Function entityref

html2text.py:90–100  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

88 return chr(c)
89
90def entityref(c):
91 if not UNICODE_SNOB and c in unifiable.keys():
92 return unifiable[c]
93 else:
94 try: name2cp(c)
95 except KeyError: return "&" + c + ';'
96 else:
97 try:
98 return unichr(name2cp(c))
99 except NameError: #Python3
100 return chr(name2cp(c))
101
102def replaceEntities(s):
103 s = s.group(1)

Callers 2

replaceEntitiesFunction · 0.85
handle_entityrefMethod · 0.85

Calls 1

name2cpFunction · 0.85

Tested by

no test coverage detected