MCPcopy Create free account
hub / github.com/executablebooks/markdown-it-py / walk

Method walk

markdown_it/tree.py:244–255  ·  view source on GitHub ↗

Recursively yield all descendant nodes in the tree starting at self. The order mimics the order of the underlying linear token stream (i.e. depth first).

(
        self: _NodeType, *, include_self: bool = True
    )

Source from the content-addressed store, hash-verified

242 return text
243
244 def walk(
245 self: _NodeType, *, include_self: bool = True
246 ) -> Generator[_NodeType, None, None]:
247 """Recursively yield all descendant nodes in the tree starting at self.
248
249 The order mimics the order of the underlying linear token
250 stream (i.e. depth first).
251 """
252 if include_self:
253 yield self
254 for child in self.children:
255 yield from child.walk(include_self=True)
256
257 # NOTE:
258 # The values of the properties defined below directly map to properties

Callers 1

test_walkFunction · 0.95

Calls

no outgoing calls

Tested by 1

test_walkFunction · 0.76