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

Method run

markdown/treeprocessors.py:465–476  ·  view source on GitHub ↗

Loop over all elements and unescape all text.

(self, root: etree.Element)

Source from the content-addressed store, hash-verified

463 return self.RE.sub(self._unescape, text)
464
465 def run(self, root: etree.Element) -> None:
466 """ Loop over all elements and unescape all text. """
467 for elem in root.iter():
468 # Unescape text content
469 if elem.text and not elem.tag == 'code':
470 elem.text = self.unescape(elem.text)
471 # Unescape tail content
472 if elem.tail:
473 elem.tail = self.unescape(elem.tail)
474 # Unescape attribute values
475 for key, value in elem.items():
476 elem.set(key, self.unescape(value))

Callers

nothing calls this directly

Calls 2

unescapeMethod · 0.95
setMethod · 0.80

Tested by

no test coverage detected