X-Git-Url: https://git.cielonegro.org/gitweb.cgi?p=Rakka.git;a=blobdiff_plain;f=Rakka%2FPage.hs;h=62606b35af111daa344d37d738dfabd4aa273172;hp=2785a201df626f216f27d309b88a3d46115902b3;hb=23977989ef4be7316b1c2c3f709ca1e8e6bb7f84;hpb=b444493e17ad49d60464bb5cf02898bd9198af3c diff --git a/Rakka/Page.hs b/Rakka/Page.hs index 2785a20..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 $ fromJust $ 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