aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock
diff options
context:
space:
mode:
authorNeil Mitchell <unknown>2008-06-26 15:09:54 +0000
committerNeil Mitchell <unknown>2008-06-26 15:09:54 +0000
commitf7525573cd1964a6a4fff3c92b737f0ee7d3621c (patch)
treedea39d8dca351eaab0e1af3a1fa61b477a36fae7 /src/Haddock
parent14c67ac66abf15a623d0f1d14cf5d20462859ebe (diff)
Remove any white space around a <li> element
Diffstat (limited to 'src/Haddock')
-rw-r--r--src/Haddock/Backends/Hoogle.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs
index 2cfdcf64..14594569 100644
--- a/src/Haddock/Backends/Hoogle.hs
+++ b/src/Haddock/Backends/Hoogle.hs
@@ -207,9 +207,11 @@ showInline = unwordsWrap 70 . words . concatMap f
where
fs = concatMap f
f (Str x) = escape x
- f (TagInline s xs) = "<"++s++">" ++ fs xs ++ "</"++s++">"
+ f (TagInline s xs) = "<"++s++">" ++ (if s == "li" then trim else id) (fs xs) ++ "</"++s++">"
f x = fs $ asInline x
+ trim = dropWhile isSpace . reverse . dropWhile isSpace . reverse
+
showPre :: [Tag] -> [String]
showPre = trimFront . trimLines . lines . concatMap f