MCPcopy Index your code
hub / github.com/Python-Markdown/markdown / backslash_unescape

Method backslash_unescape

markdown/inlinepatterns.py:530–540  ·  view source on GitHub ↗

Return text with backslash escapes undone (backslashes are restored).

(self, text: str)

Source from the content-addressed store, hash-verified

528 return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text)
529
530 def backslash_unescape(self, text: str) -> str:
531 """ Return text with backslash escapes undone (backslashes are restored). """
532 try:
533 RE = self.md.treeprocessors['unescape'].RE
534 except KeyError: # pragma: no cover
535 return text
536
537 def _unescape(m: re.Match[str]) -> str:
538 return chr(int(m.group(1)))
539
540 return RE.sub(_unescape, text)
541
542
543class AsteriskProcessor(InlineProcessor):

Callers 1

handleMatchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected