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

Method get_cached_result

markdown/inlinepatterns.py:837–850  ·  view source on GitHub ↗

Get the next element from the cache.

(self, pos: int | None = None)

Source from the content-addressed store, hash-verified

835 self.cache_index = 0
836
837 def get_cached_result(self, pos: int | None = None) -> tuple[etree.Element, int, int]:
838 """Get the next element from the cache."""
839
840 el, start, end, anchor = self.cache[self.cache_index]
841 offset = 0 if pos is None else pos - self.cache_pos
842 self.cache_index += 1
843
844 if self.cache_index < len(self.cache):
845 self.cache_pos = anchor
846 # Nothing left to process
847 else:
848 self.reset()
849
850 return el, start + offset, end + offset
851
852 @staticmethod
853 def rule_of_3(opener: int, closer: int) -> bool:

Callers 1

_handle_matchMethod · 0.95

Calls 1

resetMethod · 0.95

Tested by

no test coverage detected