no more html-formatting for the hoogle docs.

Hoogle v5 `docs` field already contains markup, so we just use the field
content directly.
This commit is contained in:
Thomas Peiselt 2018-11-01 20:46:54 +01:00
parent 6788944a45
commit 2f49c35743

View File

@ -237,21 +237,7 @@ renderSelf string loc
", " ++ mdl ++ " " ++ span "hoogle-module" modname ++ ")"
renderDocs :: String -> String
renderDocs doc =
let groups = List.groupBy bothAreCode $ lines doc
nonull = filter (not . null . strip)
bothAreCode s1 s2 =
isPrefixOf ">" (strip s1) &&
isPrefixOf ">" (strip s2)
isCode xs =
case xs of
[] -> False
(s:_) -> isPrefixOf ">" $ strip s
makeBlock xs =
if isCode xs
then div' "hoogle-code" $ unlines $ nonull xs
else div' "hoogle-text" $ unlines $ nonull xs
in div' "hoogle-doc" $ unlines $ map makeBlock groups
renderDocs doc = div' "hoogle-doc" doc
extractPackageName :: String -> Maybe String
extractPackageName lnk = do