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

Method handleMatch

markdown/inlinepatterns.py:281–300  ·  view source on GitHub ↗

Return a ElementTree element from the given match and the start and end index of the matched text. If `start` and/or `end` are returned as `None`, it will be assumed that the processor did not find a valid region of text. Subclasses should override this method.

(self, m: re.Match[str], data: str)

Source from the content-addressed store, hash-verified

279 self.md = md
280
281 def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | str | None, int | None, int | None]:
282 """Return a ElementTree element from the given match and the
283 start and end index of the matched text.
284
285 If `start` and/or `end` are returned as `None`, it will be
286 assumed that the processor did not find a valid region of text.
287
288 Subclasses should override this method.
289
290 Arguments:
291 m: A re match object containing a match of the pattern.
292 data: The buffer currently under analysis.
293
294 Returns:
295 el: The ElementTree element, text or None.
296 start: The start of the region that has been matched or None.
297 end: The end of the region that has been matched or None.
298
299 """
300 pass # pragma: no cover
301
302
303class SimpleTextPattern(Pattern): # pragma: no cover

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected