MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / codepoint2name

Method codepoint2name

markdown/inlinepatterns.py:981–987  ·  view source on GitHub ↗

Return entity definition by code, or the code if not defined.

(code: int)

Source from the content-addressed store, hash-verified

979 email = email[len("mailto:"):]
980
981 def codepoint2name(code: int) -> str:
982 """Return entity definition by code, or the code if not defined."""
983 entity = entities.codepoint2name.get(code)
984 if entity:
985 return "{}{};".format(util.AMP_SUBSTITUTE, entity)
986 else:
987 return "%s#%d;" % (util.AMP_SUBSTITUTE, code)
988
989 letters = [codepoint2name(ord(letter)) for letter in email]
990 el.text = util.AtomicString(''.join(letters))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected