From b1948eb0fa9f30fcf9d3968700419f1865f004c1 Mon Sep 17 00:00:00 2001 From: Neil Mitchell Date: Fri, 29 Sep 2006 15:52:03 +0000 Subject: Do not generate an empty table if there are no exports, this fixes a
tag being generated, which is not valid HTML 4.01 --- src/Haddock/Backends/Html.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Haddock') 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 -- cgit v1.2.3