diff --git a/Text/HTML/SanitizeXSS.hs b/Text/HTML/SanitizeXSS.hs index 530e09d..0314258 100644 --- a/Text/HTML/SanitizeXSS.hs +++ b/Text/HTML/SanitizeXSS.hs @@ -28,7 +28,7 @@ sanitizeXSS = renderTagsOptions renderOptions { safeTags m (t@(TagClose name):tags) | safeTagName name = case Map.lookup name m of - Nothing -> safeTags m tags + Nothing -> TagOpen name [] : TagClose name : safeTags m tags Just i -> let m' = if i == 1 then Map.delete name m diff --git a/test.hs b/test.hs index 80d603e..106a651 100644 --- a/test.hs +++ b/test.hs @@ -3,6 +3,6 @@ import Text.HTML.SanitizeXSS main = do let test = " safeanchor

Unbalanced" let actual = (sanitizeXSS test) - let expected = " safeanchor
Unbalanced" + let expected = " safeanchor
Unbalanced
" putStrLn $ "testing: " ++ test putStrLn $ if actual == expected then "pass" else "failure\n" ++ "\nexpected:" ++ (show expected) ++ "\nactual: " ++ (show actual)