diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/ImageSize.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs index c5289bbc2..afbba9b8b 100644 --- a/src/Text/Pandoc/ImageSize.hs +++ b/src/Text/Pandoc/ImageSize.hs @@ -278,13 +278,16 @@ pPdfSize = do A.skipWhile (/='/') A.char8 '/' (do A.string "MediaBox" + A.skipSpace A.char8 '[' + A.skipSpace [x1,y1,x2,y2] <- A.count 4 $ do - A.skipWhile (==' ') + A.skipSpace raw <- A.many1 $ A.satisfy (\c -> isDigit c || c == '.') case safeRead raw of Just (r :: Double) -> return $ floor r Nothing -> mzero + A.skipSpace A.char8 ']' return $ ImageSize{ pxX = x2 - x1 |