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

Method get_cached_result

markdown/inlinepatterns.py:804–813  ·  view source on GitHub ↗

Get a cached result.

(self, pos: int, data: str)

Source from the content-addressed store, hash-verified

802 self.reset()
803
804 def get_cached_result(self, pos: int, data: str) -> tuple[etree.Element, int, int]:
805 """Get a cached result."""
806
807 # Process the next region(s) in the cache
808 regions = self.regions
809 offset = pos - self.cache_pos if pos != self.cache_pos else pos - regions[self.cache_index][0]
810 start, end = regions[self.cache_index][0], regions[self.cache_index][3]
811 el, count = self._build_element(data, self.cache_index, offset)
812 self.increment_next_position(start, count)
813 return el, start + offset, end + offset
814
815 @staticmethod
816 def rule_of_3(opener: int, closer: int) -> bool:

Callers 1

handleMatchMethod · 0.95

Calls 2

_build_elementMethod · 0.95

Tested by

no test coverage detected