@@ -655,7 +655,7 @@ blockToHtml opts (LineBlock lns) =
655 return $ H.div ! A.class_ "line-block" $ htmlLines
655 return $ H.div ! A.class_ "line-block" $ htmlLines
656blockToHtml opts (Div attr@(ident, classes, kvs') bs) = do
656blockToHtml opts (Div attr@(ident, classes, kvs') bs) = do
657 html5 <- gets stHtml5
657 html5 <- gets stHtml5
658− let kvs = kvs' ++
658+ let kvs = [(k,v) | (k,v) <- kvs', k /= "width"] ++
659 if "column" `elem` classes
659 if "column" `elem` classes
660 then let w = fromMaybe "48%" (lookup "width" kvs')
660 then let w = fromMaybe "48%" (lookup "width" kvs')
661 in [("style", "width:" ++ w ++ ";min-width:" ++ w ++
661 in [("style", "width:" ++ w ++ ";min-width:" ++ w ++
@@ -664,7 +664,12 @@ blockToHtml opts (Div attr@(ident, classes, kvs') bs) = do
664 let speakerNotes = "notes" `elem` classes
664 let speakerNotes = "notes" `elem` classes
665 -- we don't want incremental output inside speaker notes, see #1394
665 -- we don't want incremental output inside speaker notes, see #1394
666 let opts' = if speakerNotes then opts{ writerIncremental = False } else opts
666 let opts' = if speakerNotes then opts{ writerIncremental = False } else opts
667+ contents <- if "columns" `elem` classes
668+ then -- we don't use blockListToHtml because it inserts
669+ -- a newline between the column divs, which throws
670+ -- off widths! see #4028
671+ mconcat <$> mapM (blockToHtml opts) bs
667− contents <- blockListToHtml opts' bs
672+ else blockListToHtml opts' bs
668 let contents' = nl opts >> contents >> nl opts
673 let contents' = nl opts >> contents >> nl opts
669 let (divtag, classes') = if html5 && "section" `elem` classes
674 let (divtag, classes') = if html5 && "section" `elem` classes
670 then (H5.section, filter (/= "section") classes)
675 then (H5.section, filter (/= "section") classes)