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

Function build_url

markdown/extensions/wikilinks.py:31–34  ·  view source on GitHub ↗

Build a URL from the label, a base, and an end.

(label: str, base: str, end: str)

Source from the content-addressed store, hash-verified

29
30
31def build_url(label: str, base: str, end: str) -> str:
32 """ Build a URL from the label, a base, and an end. """
33 clean_label = re.sub(r'([ ]+_)|(_[ ]+)|([ ]+)', '_', label)
34 return '{}{}{}'.format(base, clean_label, end)
35
36
37class WikiLinkExtension(Extension):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected