Skip to content

Instantly share code, notes, and snippets.

View djrobstep's full-sized avatar

Robert Lechte djrobstep

View GitHub Profile
@zachsnow
zachsnow / inline_styles_extension.py
Last active February 9, 2017 04:11
A python-markdown extension for adding inline styles to tags by tag name.
# Caveat emptor and all of that; apologies for mistakes.
class InlineStylesTreeprocessor(Treeprocessor):
"""
A treeprocessor that recursively applies inline styles
to all elements of a given tree.
"""
def __init__(self, styles):
self.styles = styles