HTML sanitize: allow controlling of allowed styles
This commit is contained in:
parent
a477c59908
commit
190fae3b9a
1 changed files with 2 additions and 2 deletions
|
@ -70,11 +70,11 @@ def sanitizeStyle(value, validStyles=validStyles):
|
|||
parts = item.split(':')
|
||||
if len(parts) == 2:
|
||||
k, v = parts
|
||||
if checkStyle(k):
|
||||
if checkStyle(k, validStyles):
|
||||
result.append(item.strip())
|
||||
return '; '.join(result)
|
||||
|
||||
def checkStyle(k):
|
||||
def checkStyle(k, validStyles=validStyles):
|
||||
k = k.strip().lower()
|
||||
if k in validStyles:
|
||||
return True
|
||||
|
|
Loading…
Add table
Reference in a new issue