inline.py 243 Bytes
Newer Older
1 2 3 4 5 6 7 8
""" Parser for inline CSS in style attributes """

def inlineStyle(styleString):
    if not styleString:
        return {}
    styles = styleString.split(";")
    rv = dict(style.split(":") for style in styles if len(style) != 0)
    return rv