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

Method __build_ancestors

markdown/treeprocessors.py:333–341  ·  view source on GitHub ↗

Build the ancestor list.

(self, parent: etree.Element | None, parents: list[str])

Source from the content-addressed store, hash-verified

331 placeholder, match.groups()[-1]), True, 0
332
333 def __build_ancestors(self, parent: etree.Element | None, parents: list[str]) -> None:
334 """Build the ancestor list."""
335 ancestors = []
336 while parent is not None:
337 if parent is not None:
338 ancestors.append(parent.tag.lower())
339 parent = self.parent_map.get(parent)
340 ancestors.reverse()
341 parents.extend(ancestors)
342
343 def run(self, tree: etree.Element, ancestors: list[str] | None = None) -> etree.Element:
344 """Apply inline patterns to a parsed Markdown tree.

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected