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

Method handleMatch

markdown/inlinepatterns.py:486–498  ·  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

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected