diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-11-02 20:55:29 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-11-02 20:57:05 -0700 |
commit | 642d603666521157d386e2a87bfdcca11d479b87 (patch) | |
tree | 2f2fef655397cfce54049cfa0c20c02a95a888e6 /src | |
parent | 52826881262532db9b0c9ce70f097d4ae844a39b (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 7 |
1 files changed, 2 insertions, 5 deletions
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 |