Jump to >


class InlineStyleProcessor(markdown_instance=None)[source]

Bases: markdown.treeprocessors.Treeprocessor

Injects CSS styles directly into the tags, for use in e-mails.

This will process each element and, depending on the element type, create inline styles. These styles are meant to match the stylesheets in the markdown-wysiwyg.less file.

process_element(context, el)[source]

Process an element in the tree.

This adds a handful of inline styles to the resulting document which mimic the .rich-text rules in markdown-wysiwyg.less.

This does not do quite everything that the markdown-wysiwyg.less rules do, due to the complexity in implementing CSS selectors in Python, and the CSS compatibility logic in most e-mail clients.

The end result is that the e-mail will look similar but not identical to the page.

class WysiwygEMailExtension(configs={})[source]

Bases: markdown.extensions.Extension

A Markdown extension to inject CSS into elements for HTML output.

This is meant as a counterpart to the Wysiwyg Markdown extension. It aims to provide HTML output that looks as similar as possible to the input, preserving the spacing, font sizes, alignment, and other styles from the raw text.

This is meant to be used with the following Markdown configuration and extensions:

    'extensions': [
        'codehilite(noclasss=True)', 'tables',
extendMarkdown(md, md_globals)[source]

Extend the list of Markdown processors.


Create a Markdown extension instance for this file.