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

Method handleMatch

markdown/inlinepatterns.py:309–328  ·  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

307 self.md = md
308
309 def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | str | None, int | None, int | None]:
310 """Return a ElementTree element from the given match and the
311 start and end index of the matched text.
312
313 If `start` and/or `end` are returned as `None`, it will be
314 assumed that the processor did not find a valid region of text.
315
316 Subclasses should override this method.
317
318 Arguments:
319 m: A re match object containing a match of the pattern.
320 data: The buffer currently under analysis.
321
322 Returns:
323 el: The ElementTree element, text or None.
324 start: The start of the region that has been matched or None.
325 end: The end of the region that has been matched or None.
326
327 """
328 pass # pragma: no cover
329
330
331class SimpleTextPattern(Pattern): # pragma: no cover

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected