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

Method backslash_unescape

markdown/inlinepatterns.py:550–560  ·  view source on GitHub ↗

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

(self, text: str)

Source from the content-addressed store, hash-verified

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

Callers 1

handleMatchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected