diff options
Diffstat (limited to 'src/Text/Pandoc/Writers/Docx.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index c2a160320..4f642871a 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -234,11 +234,11 @@ writeDocx opts doc@(Pandoc meta _) = do -- Get the available area (converting the size and the margins to int and -- doing the difference - let pgContentWidth = (-) <$> (read <$> mbAttrSzWidth ::Maybe Integer) - <*> ( - (+) <$> (read <$> mbAttrMarRight ::Maybe Integer) - <*> (read <$> mbAttrMarLeft ::Maybe Integer) - ) + let pgContentWidth = mbAttrSzWidth >>= safeRead + >>= subtrct mbAttrMarRight + >>= subtrct mbAttrMarLeft + where + subtrct mbStr = \x -> mbStr >>= safeRead >>= (\y -> Just $ x - y) -- styles mblang <- toLang $ getLang opts meta |