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

Method handleAttributes

markdown/extensions/legacy_attrs.py:57–61  ·  view source on GitHub ↗

Set attributes and return text without definitions.

(self, el: etree.Element, txt: str)

Source from the content-addressed store, hash-verified

55 el.tail = self.handleAttributes(el, el.tail)
56
57 def handleAttributes(self, el: etree.Element, txt: str) -> str:
58 """ Set attributes and return text without definitions. """
59 def attributeCallback(match: re.Match[str]):
60 el.set(match.group(1), match.group(2).replace('\n', ' '))
61 return ATTR_RE.sub(attributeCallback, txt)
62
63
64class LegacyAttrExtension(Extension):

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected