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

Method codepoint2name

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

1442 email = email[len("mailto:"):]
1443
1444 def codepoint2name(code: int) -> str:
1445 """Return entity definition by code, or the code if not defined."""
1446 entity = entities.codepoint2name.get(code)
1447 if entity:
1448 return "{}{};".format(util.AMP_SUBSTITUTE, entity)
1449 else:
1450 return "%s#%d;" % (util.AMP_SUBSTITUTE, code)
1451
1452 letters = [codepoint2name(ord(letter)) for letter in email]
1453 el.text = util.AtomicString(''.join(letters))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected