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

Method build_double

markdown/inlinepatterns.py:562–574  ·  view source on GitHub ↗

Return double tag.

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

Source from the content-addressed store, hash-verified

560 return el1
561
562 def build_double(self, m: re.Match[str], tags: str, idx: int) -> etree.Element:
563 """Return double tag."""
564
565 tag1, tag2 = tags.split(",")
566 el1 = etree.Element(tag1)
567 el2 = etree.Element(tag2)
568 text = m.group(2)
569 self.parse_sub_patterns(text, el2, None, idx)
570 el1.append(el2)
571 if len(m.groups()) == 3:
572 text = m.group(3)
573 self.parse_sub_patterns(text, el1, el2, idx)
574 return el1
575
576 def build_double2(self, m: re.Match[str], tags: str, idx: int) -> etree.Element:
577 """Return double tags (variant 2): `<strong>text <em>text</em></strong>`."""

Callers 1

build_elementMethod · 0.95

Calls 1

parse_sub_patternsMethod · 0.95

Tested by

no test coverage detected