diff options
author | John MacFarlane <jgm@berkeley.edu> | 2012-09-25 19:54:21 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2012-09-25 19:54:21 -0700 |
commit | 6ad7ac1239cb384bf830b1692991030735f43e89 (patch) | |
tree | b3f3a9399aaecb9acd7e1fa6eccc2a26bdf49191 /src/Text/Pandoc/Writers/ODT.hs | |
parent | 833977416ff8cbdcf0ebd8a6a135d7ef13fdbd73 (diff) | |
download | pandoc-6ad7ac1239cb384bf830b1692991030735f43e89.tar.gz |
Removed need for utf8-string package.
* Depend on text.
* Expose Text.Pandoc.UTF8.
* Text.Pandoc.UTF8 now exports toString, fromString,
toStringLazy, fromStringLazy.
* These are used instead of the old utf8-string functions.
Diffstat (limited to 'src/Text/Pandoc/Writers/ODT.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/ODT.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/ODT.hs b/src/Text/Pandoc/Writers/ODT.hs index f43d0a087..cbff88be5 100644 --- a/src/Text/Pandoc/Writers/ODT.hs +++ b/src/Text/Pandoc/Writers/ODT.hs @@ -32,7 +32,7 @@ import Data.IORef import Data.List ( isPrefixOf ) import System.FilePath ( (</>), takeExtension ) import qualified Data.ByteString.Lazy as B -import Data.ByteString.Lazy.UTF8 ( fromString ) +import Text.Pandoc.UTF8 ( fromStringLazy ) import Codec.Archive.Zip import Data.Time.Clock.POSIX import Paths_pandoc ( getDataFileName ) @@ -74,7 +74,7 @@ writeODT opts doc@(Pandoc (Meta title _ _) _) = do doc' <- bottomUpM (transformPic sourceDir picEntriesRef) doc let newContents = writeOpenDocument opts{writerWrapText = False} doc' epochtime <- floor `fmap` getPOSIXTime - let contentEntry = toEntry "content.xml" epochtime $ fromString newContents + let contentEntry = toEntry "content.xml" epochtime $ fromStringLazy newContents picEntries <- readIORef picEntriesRef let archive = foldr addEntryToArchive refArchive $ contentEntry : picEntries -- construct META-INF/manifest.xml based on archive @@ -86,7 +86,7 @@ writeODT opts doc@(Pandoc (Meta title _ _) _) = do ] let files = [ ent | ent <- filesInArchive archive, not ("META-INF" `isPrefixOf` ent) ] let manifestEntry = toEntry "META-INF/manifest.xml" epochtime - $ fromString $ show + $ fromStringLazy $ show $ text "<?xml version=\"1.0\" encoding=\"utf-8\"?>" $$ ( inTags True "manifest:manifest" @@ -100,7 +100,7 @@ writeODT opts doc@(Pandoc (Meta title _ _) _) = do ) let archive' = addEntryToArchive manifestEntry archive let metaEntry = toEntry "meta.xml" epochtime - $ fromString $ show + $ fromStringLazy $ show $ text "<?xml version=\"1.0\" encoding=\"utf-8\"?>" $$ ( inTags True "office:document-meta" |