git.iko.soy/typeable/pandoc
on master help sign in
Don't use OverloadedStrings in ODT writer.
7b986acfiddlosopher
Text/Pandoc/ODT.hs+3−7
@@ -1,4 +1,4 @@
1−{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}
1+{-# LANGUAGE TemplateHaskell #-}
2{-
2{-
3Copyright (C) 2008 John MacFarlane <jgm@berkeley.edu>
3Copyright (C) 2008 John MacFarlane <jgm@berkeley.edu>
4
4
@@ -43,11 +43,7 @@ import Text.XML.Light
43import Text.XML.Light.Cursor
43import Text.XML.Light.Cursor
44import Text.Pandoc.Shared ( withTempDir )
44import Text.Pandoc.Shared ( withTempDir )
45import Network.URI ( isURI )
45import Network.URI ( isURI )
46−import Data.String ( IsString (..) )
47−import qualified Data.ByteString.Char8 as B ( writeFile, pack, ByteString )
46+import qualified Data.ByteString.Char8 as B ( writeFile, pack )
48−
49−instance IsString B.ByteString
50− where fromString = B.pack
51
47
52-- | Produce an ODT file from OpenDocument XML.
48-- | Produce an ODT file from OpenDocument XML.
53saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
49saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
@@ -68,7 +64,7 @@ saveOpenDocumentAsODT destinationODTPath sourceDirRelative xml = do
68 withTempDir "pandoc-odt" $ \tempDir -> do
64 withTempDir "pandoc-odt" $ \tempDir -> do
69 let tempODT = tempDir </> "reference.odt"
65 let tempODT = tempDir </> "reference.odt"
70 copyFile "odt-styles/reference.odt" tempODT
66 copyFile "odt-styles/reference.odt" tempODT
71− B.writeFile tempODT $(contentsOf "odt-styles/reference.odt")
67+ B.writeFile tempODT $ B.pack $(contentsOf "odt-styles/reference.odt")
72 createDirectory $ tempDir </> "Pictures"
68 createDirectory $ tempDir </> "Pictures"
73 xml' <- handlePictures tempODT sourceDirRelative xml
69 xml' <- handlePictures tempODT sourceDirRelative xml
74 writeFile (tempDir </> "content.xml") xml'
70 writeFile (tempDir </> "content.xml") xml'
pandoc.cabal+1−2
@@ -74,8 +74,7 @@ Library
74 Build-depends: highlighting-kate
74 Build-depends: highlighting-kate
75 cpp-options: -DHIGHLIGHTING
75 cpp-options: -DHIGHLIGHTING
76 Build-Depends: parsec < 3, xhtml, mtl, network, filepath, process, directory, utf8-string,
76 Build-Depends: parsec < 3, xhtml, mtl, network, filepath, process, directory, utf8-string,
77− template-haskell, bytestring == 0.9.0.1
77+ template-haskell, bytestring
78− -- Note: bytestring-0.9.1.0 contains an InString instance for ByteString
79 Hs-Source-Dirs: .
78 Hs-Source-Dirs: .
80 Exposed-Modules: Text.Pandoc,
79 Exposed-Modules: Text.Pandoc,
81 Text.Pandoc.Blocks,
80 Text.Pandoc.Blocks,