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

Method codepoint2name

markdown/inlinepatterns.py:1332–1338  ·  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

1330 email = email[len("mailto:"):]
1331
1332 def codepoint2name(code: int) -> str:
1333 """Return entity definition by code, or the code if not defined."""
1334 entity = entities.codepoint2name.get(code)
1335 if entity:
1336 return "{}{};".format(util.AMP_SUBSTITUTE, entity)
1337 else:
1338 return "%s#%d;" % (util.AMP_SUBSTITUTE, code)
1339
1340 letters = [codepoint2name(ord(letter)) for letter in email]
1341 el.text = util.AtomicString(''.join(letters))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected