From 380c1e439bf38ad892f3c111135b7d3f115ce62e Mon Sep 17 00:00:00 2001 From: Tissevert Date: Wed, 27 Nov 2019 18:01:03 +0100 Subject: [PATCH] Fix a bug preventing Hufflepdf from reading objects with a ' ' after the `obj` keyword --- ChangeLog.md | 4 ++++ Hufflepdf.cabal | 2 +- src/PDF/Object.hs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8f52e5f..772fe58 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,9 @@ # Revision history for Hufflepdf +## 0.2.0.1 -- 2019-11-27 + +* Fix bug discovered while running Hufflepdf on a PDF output from pdftk : magic keywords like `obj`, `stream` or `xref` can have spaces after them before the EOL + ## 0.2.0.0 -- 2019-10-14 * Implement PDF's multilayer update mechanism diff --git a/Hufflepdf.cabal b/Hufflepdf.cabal index f406ab5..bb4af94 100644 --- a/Hufflepdf.cabal +++ b/Hufflepdf.cabal @@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: Hufflepdf -version: 0.2.0.0 +version: 0.2.0.1 synopsis: A PDF parser -- description: license: BSD3 diff --git a/src/PDF/Object.hs b/src/PDF/Object.hs index fc116e4..5971033 100644 --- a/src/PDF/Object.hs +++ b/src/PDF/Object.hs @@ -49,7 +49,7 @@ import PDF.Parser ( import Text.Printf (printf) line :: String -> Parser u () -line l = (string (BS.pack l) *> EOL.parser *> return ()) printf "line «%s»" l +line l = (string (BS.pack l) *> blank *> return ()) printf "line «%s»" l magicNumber :: ByteString magicNumber = "%PDF-"