X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Rakka%2FPage.hs;h=62606b35af111daa344d37d738dfabd4aa273172;hb=23977989ef4be7316b1c2c3f709ca1e8e6bb7f84;hp=16835d5aafd79e247d227e557e93d77eb267e0ea;hpb=0447be1b59496ca4266226ed52d264009cf41899;p=Rakka.git diff --git a/Rakka/Page.hs b/Rakka/Page.hs index 16835d5..62606b3 100644 --- a/Rakka/Page.hs +++ b/Rakka/Page.hs @@ -240,6 +240,7 @@ xmlizePage += ( eelem "page" += sattr "name" (redirName page) += sattr "redirect" (redirDest page) + += sattr "isLocked" (yesOrNo $ redirIsLocked page) += sattr "revision" (show $ redirRevision page) += sattr "lastModified" (formatW3CDateTime lastMod) )) -<< () @@ -344,7 +345,7 @@ parseEntity let (isBinary, content) = case (textData, binaryData) of (Just text, Nothing ) -> (False, L.pack $ UTF8.encode text ) - (Nothing , Just binary) -> (True , L.pack $ B64.decode binary) + (Nothing , Just binary) -> (True , L.pack $ fromJust $ B64.decode $ dropWhitespace binary) _ -> error "one of textData or binaryData is required" mimeType = if isBinary then @@ -370,6 +371,14 @@ parseEntity , entityContent = content , entityUpdateInfo = updateInfo } + where + dropWhitespace :: String -> String + dropWhitespace [] = [] + dropWhitespace (x:xs) + | x == ' ' || x == '\t' || x == '\n' + = dropWhitespace xs + | otherwise + = x : dropWhitespace xs parseUpdateInfo :: (ArrowXml a, ArrowChoice a) => a XmlTree UpdateInfo