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

Method __build_ancestors

markdown/treeprocessors.py:338–346  ·  view source on GitHub ↗

Build the ancestor list.

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

Source from the content-addressed store, hash-verified

336 )
337
338 def __build_ancestors(self, parent: etree.Element | None, parents: list[str]) -> None:
339 """Build the ancestor list."""
340 ancestors = []
341 while parent is not None:
342 if parent is not None:
343 ancestors.append(parent.tag.lower())
344 parent = self.parent_map.get(parent)
345 ancestors.reverse()
346 parents.extend(ancestors)
347
348 def run(self, tree: etree.Element, ancestors: list[str] | None = None) -> etree.Element:
349 """Apply inline patterns to a parsed Markdown tree.

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected