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

Method handleMatch

markdown/inlinepatterns.py:487–499  ·  view source on GitHub ↗

Return [`Element`][xml.etree.ElementTree.Element] in following format: ` group(3) group(4) ` where `group(4)` is optional.

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

Source from the content-addressed store, hash-verified

485
486 """
487 def handleMatch(self, m: re.Match[str]) -> etree.Element:
488 """
489 Return [`Element`][xml.etree.ElementTree.Element] in following format:
490 `<tag1><tag2>group(3)</tag2>group(4)</tag2>` where `group(4)` is optional.
491
492 """
493 tag1, tag2 = self.tag.split(",")
494 el1 = etree.Element(tag1)
495 el2 = etree.SubElement(el1, tag2)
496 el2.text = m.group(3)
497 if len(m.groups()) == 5:
498 el2.tail = m.group(4)
499 return el1
500
501
502class DoubleTagInlineProcessor(SimpleTagInlineProcessor):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected