pybluemonday
pybluemonday copied to clipboard
Add support for inline css
Thank you for this library! Is it possible to add support for inline css?
Example taken from: https://github.com/microcosm-cc/bluemonday#inline-css
from pybluemonday import UGCPolicy
s = UGCPolicy()
s.AllowStyles("text-decoration").MatchingEnum("underline", "line-through", "none").OnElements("span")
It returns an error:
In [16]: s.AllowStyles("text-decoration").MatchingEnum("underline", "line-through", "none").OnElements("span")
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [16], in <cell line: 1>()
----> 1 s.AllowStyles("text-decoration").MatchingEnum("underline", "line-through", "none").OnElements("span")
AttributeError: 'NoneType' object has no attribute 'MatchingEnum'