MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / codepoint2name

Method codepoint2name

markdown/inlinepatterns.py:355–361  ·  view source on GitHub ↗

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

(code)

Source from the content-addressed store, hash-verified

353 email = email[len("mailto:"):]
354
355 def codepoint2name(code):
356 """Return entity definition by code, or the code if not defined."""
357 entity = html.entities.codepoint2name.get(code)
358 if entity:
359 return "%s%s;" % (markdown.AMP_SUBSTITUTE, entity)
360 else:
361 return "%s#%d;" % (markdown.AMP_SUBSTITUTE, code)
362
363 letters = [codepoint2name(ord(letter)) for letter in email]
364 el.text = markdown.AtomicString(''.join(letters))

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected