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

Method handleMatch

markdown/inlinepatterns.py:384–391  ·  view source on GitHub ↗

Return [`Element`][xml.etree.ElementTree.Element] of type `tag` with the string in `group(2)` of a matching pattern as the Element's text.

(self, m: re.Match[str], data: str)

Source from the content-addressed store, hash-verified

382 """ The tag of the rendered element. """
383
384 def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element, int, int]: # pragma: no cover
385 """
386 Return [`Element`][xml.etree.ElementTree.Element] of type `tag` with the string in `group(2)` of a
387 matching pattern as the Element's text.
388 """
389 el = etree.Element(self.tag)
390 el.text = m.group(2)
391 return el, m.start(0), m.end(0)
392
393
394class SubstituteTagPattern(SimpleTagPattern): # pragma: no cover

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected