MCPcopy Create free account
hub / github.com/executablebooks/markdown-it-py / map_domain

Function map_domain

markdown_it/_punycode.py:39–49  ·  view source on GitHub ↗
(string: str, fn: Callable[[str], str])

Source from the content-addressed store, hash-verified

37
38
39def map_domain(string: str, fn: Callable[[str], str]) -> str:
40 parts = string.split("@")
41 result = ""
42 if len(parts) > 1:
43 # In email addresses, only the domain name should be punycoded. Leave
44 # the local part (i.e. everything up to `@`) intact.
45 result = parts[0] + "@"
46 string = parts[1]
47 labels = REGEX_SEPARATORS.split(string)
48 encoded = ".".join(fn(label) for label in labels)
49 return result + encoded
50
51
52def to_unicode(obj: str) -> str:

Callers 2

to_unicodeFunction · 0.85
to_asciiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…