turn tagPosition off - test passes

This commit is contained in:
Greg Weber 2010-09-24 12:15:12 -07:00
parent eb71e1dd0c
commit 705b84b75b
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import Text.HTML.TagSoup
sanitizeXSS :: String -> String
sanitizeXSS = renderTagsOptions renderOptions {
optMinimize = \x -> x `elem` ["br","img"]
} . safeTags . parseTagsOptions parseOptions { optTagPosition = True }
} . safeTags . parseTags -- Options parseOptions { optTagPosition = True }
where
safeTags :: [Tag String] -> [Tag String]
safeTags [] = []

View File

@ -3,5 +3,5 @@ import Text.HTML.SanitizeXSS
main = do
let test = " <a href='unsafe://hack.com'>anchor</a> <img src='evil://evil.com' /> <unsafe></foo> <bar /> <br></br> "
let actual = (sanitizeXSS test)
let expected = " <a>anchor</a> <img /> <br /> "
let expected = " <a>anchor</a> <img /> <br /> "
putStrLn $ if actual == expected then "pass" else "failure parsing:" ++ (show test) ++ "\nexpected:" ++ (show expected) ++ "\nactual: " ++ (show actual)