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

Class _InlineProcessorThatRecordsSearchIndex

tests/test_apis.py:756–767  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

754
755
756class _InlineProcessorThatRecordsSearchIndex(inlinepatterns.InlineProcessor):
757 """Record each offset passed to the processor's compiled expression."""
758
759 def __init__(self, pattern, md):
760 super().__init__(pattern, md)
761 self.start_indices = []
762
763 def getCompiledRegExp(self):
764 return _RecordingPattern(self.compiled_re, self.start_indices)
765
766 def handleMatch(self, m, data):
767 return m.group(0), m.start(0), m.end(0)
768
769
770class TestConfigParsing(unittest.TestCase):

Calls

no outgoing calls