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

Class _RecordingPattern

tests/test_apis.py:744–753  ·  view source on GitHub ↗

Proxy a compiled pattern while recording the search offsets.

Source from the content-addressed store, hash-verified

742
743
744class _RecordingPattern:
745 """Proxy a compiled pattern while recording the search offsets."""
746
747 def __init__(self, pattern, start_indices):
748 self.pattern = pattern
749 self.start_indices = start_indices
750
751 def finditer(self, data, start_index=0):
752 self.start_indices.append(start_index)
753 return self.pattern.finditer(data, start_index)
754
755
756class _InlineProcessorThatRecordsSearchIndex(inlinepatterns.InlineProcessor):

Callers 1

getCompiledRegExpMethod · 0.85

Calls

no outgoing calls

Tested by 1

getCompiledRegExpMethod · 0.68