diff options
author | Neil Mitchell <unknown> | 2006-09-29 15:52:03 +0000 |
---|---|---|
committer | Neil Mitchell <unknown> | 2006-09-29 15:52:03 +0000 |
commit | b1948eb0fa9f30fcf9d3968700419f1865f004c1 (patch) | |
tree | eabb67c04571d76c8b70a4f86bf74318b01ab313 /src | |
parent | 3f749b43aa90adb94d3faeb5c3b0f7cc38523817 (diff) |
Do not generate an empty table if there are no exports, this fixes a <table></table> tag being generated, which is not valid HTML 4.01
Diffstat (limited to 'src')
-rw-r--r-- | src/Haddock/Backends/Html.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Haddock/Backends/Html.hs b/src/Haddock/Backends/Html.hs index ae78f9fc..9d7759b4 100644 --- a/src/Haddock/Backends/Html.hs +++ b/src/Haddock/Backends/Html.hs @@ -549,7 +549,7 @@ ppHtmlModule odir doctitle ifaceToHtml :: SourceURLs -> WikiURLs -> Interface -> HtmlTable ifaceToHtml maybe_source_url maybe_wiki_url iface - = abovesSep s15 (contents: description: synopsis: maybe_doc_hdr: bdy) + = abovesSep s15 (contents ++ description: synopsis: maybe_doc_hdr: bdy) where docMap = ifaceRnDocMap iface @@ -562,7 +562,7 @@ ifaceToHtml maybe_source_url maybe_wiki_url iface no_doc_at_all = not (any has_doc exports) - contents = td << vanillaTable << ppModuleContents exports + contents = td << vanillaTable << ppModuleContents exports description = case ifaceRnDoc iface of @@ -593,11 +593,11 @@ ifaceToHtml maybe_source_url maybe_wiki_url iface linksInfo = (maybe_source_url, maybe_wiki_url, iface) -ppModuleContents :: [ExportItem DocName] -> HtmlTable +ppModuleContents :: [ExportItem] -> HtmlTable ppModuleContents exports - | length sections == 0 = Html.emptyTable - | otherwise = tda [theclass "section4"] << bold << toHtml "Contents" - </> td << dlist << concatHtml sections + | length sections == 0 = Nothing + | otherwise = Just (tda [theclass "section4"] << bold << toHtml "Contents" + </> td << dlist << concatHtml sections) where (sections, _leftovers{-should be []-}) = process 0 exports |