summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-05-25 22:48:27 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-05-25 22:48:27 +0200
commitcb7b0a69859cbf838519c5ad5f35d40ffd4f4246 (patch)
tree6b4449b94e0f218598b430ce1cf6e13a35e67b0f /src/Text/Pandoc/Writers/HTML.hs
parent708973a33a0ce425bb21a5ffa06fbdab465d3fb8 (diff)
Allow em for image height/width in HTML, LaTeX.
- Export `inEm` from ImageSize [API change]. - Change `showFl` and `show` instance for `Dimension` so extra decimal places are omitted. - Added `Em` as a constructor of `Dimension` [API change]. - Allow `em`, `cm`, `in` to pass through without conversion in HTML, LaTeX. Closes #3450.
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 63e839684..2a72f6f3d 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -533,10 +533,9 @@ dimensionsToAttrList :: WriterOptions -> Attr -> [(String, String)]
dimensionsToAttrList opts attr = (go Width) ++ (go Height)
where
go dir = case (dimension dir attr) of
- (Just (Percent a)) -> [("style", show dir ++ ":" ++ show (Percent a))]
- (Just dim) -> [(show dir, showInPixel opts dim)]
- _ -> []
-
+ (Just (Pixel a)) -> [(show dir, show a)]
+ (Just x) -> [("style", show dir ++ ":" ++ show x)]
+ Nothing -> []
imageExts :: [String]
imageExts = [ "art", "bmp", "cdr", "cdt", "cpt", "cr2", "crw", "djvu", "erf",