diff --git a/langfilter/Glosses.hs b/langfilter/Glosses.hs index 424cf18..2557844 100644 --- a/langfilter/Glosses.hs +++ b/langfilter/Glosses.hs @@ -9,16 +9,20 @@ import Text.Pandoc.Builder import Text.Pandoc.Walk import Data.Maybe import Data.Text (Text) +import qualified Data.Text as Text glosses :: Vars => Block -> IO [Block] glosses = \case - Div (_, cs, _) blocks | "glosses" `elem` cs -> do + Div (i, cs, _) blocks | "glosses" `elem` cs -> do tables <- traverse glossTable blocks pure $ - [RawBlock (Format "html") "
"] ++ + [RawBlock (Format "html") $ " id <> classes <> ">"] ++ catMaybes tables ++ [RawBlock (Format "html") "
"] + where + id = if i == "" then "" else " id=\"" <> i <> "\"" + classes = " class=\"" <> Text.unwords cs <> "\"" b -> pure [b] pattern Gloss l g w t = BulletList [[Plain l], [Plain g], [Plain w], [Plain t]]