pybluemonday icon indicating copy to clipboard operation
pybluemonday copied to clipboard

Add support for inline css

Open jozo opened this issue 3 years ago • 0 comments

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'

jozo avatar Apr 28 '22 12:04 jozo