From 642d603666521157d386e2a87bfdcca11d479b87 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 2 Nov 2017 20:55:29 -0700 Subject: Improved support for columns in HTML. * Move as much as possible to the CSS in the template. * Ensure that all the HTML-based templates (including epub) contain the CSS for columns. * Columns default to 50% width unless they are given a width attribute. Closes #4028. --- src/Text/Pandoc/Writers/HTML.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 1999bdbcf..2dc8b7a61 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -658,11 +658,8 @@ blockToHtml opts (LineBlock lns) = blockToHtml opts (Div attr@(ident, classes, kvs') bs) = do html5 <- gets stHtml5 let kvs = [(k,v) | (k,v) <- kvs', k /= "width"] ++ - if "column" `elem` classes - then let w = fromMaybe "48%" (lookup "width" kvs') - in [("style", "width:" ++ w ++ ";min-width:" ++ w ++ - ";vertical-align:top;")] - else [] + [("style", "width:" ++ w ++ ";") + | ("width",w) <- kvs', "column" `elem` classes] let speakerNotes = "notes" `elem` classes -- we don't want incremental output inside speaker notes, see #1394 let opts' = if speakerNotes then opts{ writerIncremental = False } else opts -- cgit v1.2.3