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

Class _InlineProcessorThatRecordsSearchIndex

tests/test_apis.py:780–791  ·  view source on GitHub ↗

Record each offset passed to the processor's compiled expression.

Source from the content-addressed store, hash-verified

778
779
780class _InlineProcessorThatRecordsSearchIndex(inlinepatterns.InlineProcessor):
781 """Record each offset passed to the processor's compiled expression."""
782
783 def __init__(self, pattern, md):
784 super().__init__(pattern, md)
785 self.start_indices = []
786
787 def getCompiledRegExp(self):
788 return _RecordingPattern(self.compiled_re, self.start_indices)
789
790 def handleMatch(self, m, data):
791 return m.group(0), m.start(0), m.end(0)
792
793
794class TestConfigParsing(unittest.TestCase):

Calls

no outgoing calls