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

Class _RecordingPattern

tests/test_apis.py:768–777  ·  view source on GitHub ↗

Proxy a compiled pattern while recording the search offsets.

Source from the content-addressed store, hash-verified

766
767
768class _RecordingPattern:
769 """Proxy a compiled pattern while recording the search offsets."""
770
771 def __init__(self, pattern, start_indices):
772 self.pattern = pattern
773 self.start_indices = start_indices
774
775 def finditer(self, data, start_index=0):
776 self.start_indices.append(start_index)
777 return self.pattern.finditer(data, start_index)
778
779
780class _InlineProcessorThatRecordsSearchIndex(inlinepatterns.InlineProcessor):

Callers 1

getCompiledRegExpMethod · 0.85

Calls

no outgoing calls

Tested by 1

getCompiledRegExpMethod · 0.68