Fix HTML5 rendition.
authorJulien Moutinho <julm+hdoc@autogeree.net>
Wed, 11 Apr 2018 21:14:42 +0000 (23:14 +0200)
committerJulien Moutinho <julm+hdoc@autogeree.net>
Wed, 11 Apr 2018 21:36:29 +0000 (23:36 +0200)
Language/DTC/Write/HTML5.hs
Text/Blaze/DTC.hs
Text/Blaze/HTML5.hs
style/dtc-html5.css

index 9150fd0ec79b6cfd1f4b04f53c6cf18e7798ee49..f074487bf0ea97619608d0923f019eac2a6d73e5 100644 (file)
@@ -422,14 +422,15 @@ instance Html5ify Block where
                                                 then H.a ! HA.href ("#"<>attrify pos) $$ mempty
                                                 else
                                                        H.td ! HA.class_ "figure-number" $$ do
-                                                               H.a ! HA.href ("#"<>attrify pos) $$ do
+                                                               H.a ! HA.href ("#"<>attrify (DTC.posAncestorsWithFigureNames pos)) $$ do
                                                                        html5ify type_
-                                                                       html5ify $ DTC.posAncestors pos
-                                               forM_ mayTitle $ \title ->
-                                                       H.td ! HA.class_ "figure-title" $$ do
+                                                                       html5ify $ DTC.posAncestorsWithFigureNames pos
+                                               forM_ mayTitle $ \title -> do
+                                                       H.td ! HA.class_ "figure-colon" $$ do
                                                                unless (TL.null type_) $ do
                                                                        Loqualization loc <- liftStateMarkup $ S.gets state_l10n
                                                                        Plain.l10n_Colon loc
+                                                       H.td ! HA.class_ "figure-title" $$ do
                                                                html5ify title
                        H.div ! HA.class_ "figure-content" $$ do
                                html5ify paras
index b2d86172e11418b08f6708a4c0ee663dd0c17bd3..bf4ce6f74a2b7aae6a0870f67f8c950819ac113f 100644 (file)
@@ -149,4 +149,6 @@ isInlinedElement = \case
  "note" -> True
  "q"    -> True
  "u"    -> True
+ "sup"  -> True
+ "sub"  -> True
  _      -> False
index df6335d4bb3a6d8aa64eb78a2f5c1763a1e8489a..15b872beecb20696944fe8db8eac056a44608943 100644 (file)
@@ -6,13 +6,15 @@ import Data.Text (Text)
 
 isInlinedElement :: Text -> Bool
 isInlinedElement = \case
- "a"    -> True
- "b"    -> True
- "br"   -> True
- "code" -> True
- "em"   -> True
- "i"    -> True
- "q"    -> True
- "u"    -> True
- "span" -> True
- _      -> False
+ "a"      -> True
+ "br"     -> True
+ "code"   -> True
+ "em"     -> True
+ "i"      -> True
+ "q"      -> True
+ "span"   -> True
+ "sub"    -> True
+ "sup"    -> True
+ "strong" -> True
+ "u"      -> True
+ _        -> False
index dd3c4412e8b5cb15882fa296db549e436deaf2e7..0bf769909655e23174469672d7e5095eb34c3a95 100644 (file)
                font-weight:bold;
                vertical-align:top;
         }
-       .figure .figure-caption td.figure-number {
+       .figure .figure-caption .figure-colon {
+               font-weight:bold;
+               vertical-align:top;
         }
        .figure .figure-caption .figure-title {
+               padding-left:1ex;
                text-align:left;
                vertical-align:middle;
         }