hoodle-parser 0.2 → 0.2.1
raw patch · 2 files changed
+19/−4 lines, 2 filesdep ~hoodle-typesPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hoodle-types
API changes (from Hackage documentation)
+ Text.Hoodle.Parse.Attoparsec: revision :: Parser Revision
Files
hoodle-parser.cabal view
@@ -1,5 +1,5 @@ Name: hoodle-parser-Version: 0.2+Version: 0.2.1 Synopsis: Hoodle file parser Description: Text parser for hoodle xml file Homepage: http://ianwookim.org/hoodle@@ -26,7 +26,7 @@ bytestring >= 0.9, containers >= 0.4, strict == 0.3.*, - hoodle-types >= 0.2, + hoodle-types >= 0.2.1, xournal-types >= 0.5.0.1, text == 0.11.*, lens >= 2.5, @@ -36,7 +36,6 @@ Text.Hoodle.Migrate.V0_1_1_to_V0_2 Text.Hoodle.Parse.Attoparsec Text.Hoodle.Parse.Attoparsec.V0_1_1- -- Text.Hoodle.Parse.Attoparsec.V0_1_999 Text.Hoodle.Parse.Zlib
src/Text/Hoodle/Parse/Attoparsec.hs view
@@ -313,12 +313,14 @@ trim t <- title <?> "title" trim+ revs <- many (revision <?> "revision")+ skipSpace pdf <- (try (Just <$> embeddedpdf) <|> return Nothing ) pgs <- many1 (page <?> "page") trim hoodleclose - return $ H.Hoodle hid t pdf pgs + return $ H.Hoodle hid t revs pdf pgs page :: Parser H.Page page = do trim @@ -354,6 +356,20 @@ titleclose :: Parser B.ByteString titleclose = string "</title>"++revision :: Parser H.Revision +revision = do skipSpace+ string "<revision" + skipSpace + string "revmd5=\""+ md5str <- manyTill anyChar (try (char '"'))+ skipSpace + string "revtxt=\""+ txtstr <- manyTill anyChar (try (char '"')) + skipSpace+ string "/>"+ return (H.Revision (B.pack md5str) (B.pack txtstr))+ embeddedpdf :: Parser (B.ByteString) embeddedpdf = do string "<embeddedpdf"