tcms.utils.markdown module

class tcms.utils.markdown.StrikeThroughExtension(**kwargs)[source]

Bases: markdown.extensions.Extension

extendMarkdown(md)[source]

Add the various proccesors and patterns to the Markdown Instance.

This method must be overriden by every extension.

Keyword arguments:

  • md: The Markdown instance.
  • md_globals: Global variables in the markdown module namespace.
class tcms.utils.markdown.StrikeThroughInlineProcessor(pattern, md=None)[source]

Bases: markdown.inlinepatterns.InlineProcessor

See https://python-markdown.github.io/extensions/api/#example_3

handleMatch(m, data)[source]

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.

Keyword arguments:

  • m: A re match object containing a match of the pattern.
  • data: The buffer current under analysis

Returns:

  • el: The ElementTree element, text or None.
  • start: The start of the region that has been matched or None.
  • end: The end of the region that has been matched or None.
tcms.utils.markdown.makeExtension(**kwargs)[source]