diff options
author | Simon Hengel <sol@typeful.net> | 2012-01-12 21:28:14 +0100 |
---|---|---|
committer | Simon Hengel <sol@typeful.net> | 2012-01-12 21:28:14 +0100 |
commit | 11385cf01f0d852782444ebfeb4e5092c174c6f8 (patch) | |
tree | 6466cbdf0eebf6ef831e6f099578265d3d5ca8c8 /src/Haddock/Backends/Xhtml/Layout.hs | |
parent | 949849c3fde2ea2838b143717f250c4cce9e026e (diff) |
Make sure that generated xhtml is valid (close #186)
Thanks to Phyx.
Diffstat (limited to 'src/Haddock/Backends/Xhtml/Layout.hs')
-rw-r--r-- | src/Haddock/Backends/Xhtml/Layout.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Haddock/Backends/Xhtml/Layout.hs b/src/Haddock/Backends/Xhtml/Layout.hs index bdd5ac78..da17552c 100644 --- a/src/Haddock/Backends/Xhtml/Layout.hs +++ b/src/Haddock/Backends/Xhtml/Layout.hs @@ -18,6 +18,7 @@ module Haddock.Backends.Xhtml.Layout ( divIndex, divAlphabet, divModuleList, sectionName, + nonEmptySectionName, shortDeclList, shortSubDecls, @@ -66,6 +67,14 @@ sectionName :: Html -> Html sectionName = paragraph ! [theclass "caption"] +-- | Make an element that always has at least something (a non-breaking space) +-- If it would have otherwise been empty, then give it the class ".empty" +nonEmptySectionName :: Html -> Html +nonEmptySectionName c + | isNoHtml c = paragraph ! [theclass "caption empty"] $ spaceHtml + | otherwise = paragraph ! [theclass "caption"] $ c + + divPackageHeader, divContent, divModuleHeader, divFooter, divTableOfContents, divDescription, divSynposis, divInterface, divIndex, divAlphabet, divModuleList |