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

Method backslash_unescape

markdown/inlinepatterns.py:549–559  ·  view source on GitHub ↗

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

(self, text: str)

Source from the content-addressed store, hash-verified

547 return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text)
548
549 def backslash_unescape(self, text: str) -> str:
550 """ Return text with backslash escapes undone (backslashes are restored). """
551 try:
552 RE = self.md.treeprocessors['unescape'].RE
553 except KeyError: # pragma: no cover
554 return text
555
556 def _unescape(m: re.Match[str]) -> str:
557 return chr(int(m.group(1)))
558
559 return RE.sub(_unescape, text)
560
561
562class Delimiter:

Callers 1

handleMatchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected