white space removal
This commit is contained in:
parent
49ce944fba
commit
773f3951e1
@ -87,7 +87,7 @@ safeAttribute (name, value) = name `member` sanitaryAttributes &&
|
|||||||
(name `notMember` uri_attributes || sanitaryURI value)
|
(name `notMember` uri_attributes || sanitaryURI value)
|
||||||
|
|
||||||
sanitizeAttribute :: (Text, Text) -> Maybe (Text, Text)
|
sanitizeAttribute :: (Text, Text) -> Maybe (Text, Text)
|
||||||
sanitizeAttribute ("style", value) =
|
sanitizeAttribute ("style", value) =
|
||||||
let css = sanitizeCSS value in if T.null css then Nothing else Just ("style", css)
|
let css = sanitizeCSS value in if T.null css then Nothing else Just ("style", css)
|
||||||
sanitizeAttribute attr = Just attr
|
sanitizeAttribute attr = Just attr
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,7 @@ sanitizeCSS css = toStrict . toLazyText .
|
|||||||
allowed_css_unit_properties = fromList ["background","border","margin","padding"]
|
allowed_css_unit_properties = fromList ["background","border","margin","padding"]
|
||||||
|
|
||||||
allowedCssAttributeValue :: Text -> Bool
|
allowedCssAttributeValue :: Text -> Bool
|
||||||
allowedCssAttributeValue val =
|
allowedCssAttributeValue val =
|
||||||
val `member` allowed_css_keywords ||
|
val `member` allowed_css_keywords ||
|
||||||
case parseOnly allowedCssAttributeParser val of
|
case parseOnly allowedCssAttributeParser val of
|
||||||
Left _ -> False
|
Left _ -> False
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user