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

Method previous_sibling

markdown_it/tree.py:179–187  ·  view source on GitHub ↗

Get the previous node in the sequence of siblings. Returns `None` if this is the first sibling.

(self: _NodeType)

Source from the content-addressed store, hash-verified

177
178 @property
179 def previous_sibling(self: _NodeType) -> _NodeType | None:
180 """Get the previous node in the sequence of siblings.
181
182 Returns `None` if this is the first sibling.
183 """
184 self_index = self.siblings.index(self)
185 if self_index - 1 >= 0:
186 return self.siblings[self_index - 1]
187 return None
188
189 def _add_child(
190 self,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected