aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src/Haddock/Backends/Xhtml
diff options
context:
space:
mode:
authorPhil Ruffwind <rf@rufflewind.com>2015-07-27 05:58:58 -0400
committerMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2015-08-02 23:30:07 +0100
commitc274363d5d868c838c382a52428c667090514f86 (patch)
tree29bd0b47564a8812306606d190d1fe6513fc4579 /haddock-api/src/Haddock/Backends/Xhtml
parente190efe089a0bd038c7de41c1c52ef580e52712c (diff)
Fix record field alignment when name is too long
Change <dl> to <ul> and use display:table rather than floats to layout the record fields. This avoids bug #301 that occurs whenever the field name gets too long. Slight aesthetic change: the entire cell of the field's source code is now shaded gray rather than just the area where text exists. Fixes #301. Closes #421
Diffstat (limited to 'haddock-api/src/Haddock/Backends/Xhtml')
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Layout.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
index e79c2c3d..4714c1b6 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
@@ -127,14 +127,12 @@ divSubDecls cssClass captionName = maybe noHtml wrap
subDlist :: Qualification -> [SubDecl] -> Maybe Html
subDlist _ [] = Nothing
-subDlist qual decls = Just $ dlist << map subEntry decls +++ clearDiv
+subDlist qual decls = Just $ ulist << map subEntry decls
where
subEntry (decl, mdoc, subs) =
- dterm ! [theclass "src"] << decl
- +++
- docElement ddef << (fmap (docToHtml Nothing qual) mdoc +++ subs)
-
- clearDiv = thediv ! [ theclass "clear" ] << noHtml
+ li <<
+ (define ! [theclass "src"] << decl +++
+ docElement thediv << (fmap (docToHtml Nothing qual) mdoc +++ subs))
subTable :: Qualification -> [SubDecl] -> Maybe Html