@@ -30,7 +30,6 @@ writers.
31module Main where
31module Main where
32import Text.Pandoc
32import Text.Pandoc
33−import Text.Pandoc.UTF8
34import Text.Pandoc.ODT
33import Text.Pandoc.ODT
35import Text.Pandoc.Shared ( joinWithSep, HTMLMathMethod (..) )
34import Text.Pandoc.Shared ( joinWithSep, HTMLMathMethod (..) )
36import Text.Pandoc.Highlighting ( languages )
35import Text.Pandoc.Highlighting ( languages )
@@ -38,7 +37,9 @@ import System.Environment ( getArgs, getProgName, getEnvironment )
38import System.Exit ( exitWith, ExitCode (..) )
37import System.Exit ( exitWith, ExitCode (..) )
39import System.FilePath ( takeExtension, takeDirectory )
38import System.FilePath ( takeExtension, takeDirectory )
40import System.Console.GetOpt
39import System.Console.GetOpt
40+import Prelude hiding ( putStrLn, writeFile, readFile, getContents )
41−import System.IO
41+import System.IO ( stdout, stderr )
42import Data.Maybe ( fromMaybe )
43import Data.Maybe ( fromMaybe )
43import Data.Char ( toLower )
44import Data.Char ( toLower )
44import Control.Monad ( (>>=) )
45import Control.Monad ( (>>=) )
@@ -275,7 +276,7 @@ options =
275 (\arg opt -> do
276 (\arg opt -> do
276 let old = optIncludeInHeader opt
277 let old = optIncludeInHeader opt
277 text <- readFile arg
278 text <- readFile arg
278− return opt { optIncludeInHeader = old ++ fromUTF8 text,
279+ return opt { optIncludeInHeader = old ++ text,
279 optStandalone = True })
280 optStandalone = True })
280 "FILENAME")
281 "FILENAME")
281 "" -- "File to include at end of header (implies -s)"
282 "" -- "File to include at end of header (implies -s)"
@@ -285,7 +286,7 @@ options =
285 (\arg opt -> do
286 (\arg opt -> do
286 let old = optIncludeBeforeBody opt
287 let old = optIncludeBeforeBody opt
287 text <- readFile arg
288 text <- readFile arg
288− return opt { optIncludeBeforeBody = old ++ fromUTF8 text })
289+ return opt { optIncludeBeforeBody = old ++ text })
289 "FILENAME")
290 "FILENAME")
290 "" -- "File to include before document body"
291 "" -- "File to include before document body"
@@ -294,7 +295,7 @@ options =
294 (\arg opt -> do
295 (\arg opt -> do
295 let old = optIncludeAfterBody opt
296 let old = optIncludeAfterBody opt
296 text <- readFile arg
297 text <- readFile arg
297− return opt { optIncludeAfterBody = old ++ fromUTF8 text })
298+ return opt { optIncludeAfterBody = old ++ text })
298 "FILENAME")
299 "FILENAME")
299 "" -- "File to include after document body"
300 "" -- "File to include after document body"
@@ -302,7 +303,7 @@ options =
303 (\arg opt -> do
304 (\arg opt -> do
304 text <- readFile arg
305 text <- readFile arg
305− return opt { optCustomHeader = fromUTF8 text,
306+ return opt { optCustomHeader = text,
306 optStandalone = True })
307 optStandalone = True })
307 "FILENAME")
308 "FILENAME")
308 "" -- "File to use for custom header (implies -s)"
309 "" -- "File to use for custom header (implies -s)"
@@ -555,10 +556,11 @@ main = do
555 then putStrLn
556 then putStrLn
556 else writeFile outputFile . (++ "\n")
557 else writeFile outputFile . (++ "\n")
558− (readSources sources) >>= writeOutput . toUTF8 .
559+ (readSources sources) >>= writeOutput .
559− (writer writerOptions) .
560+ writer writerOptions .
560− (reader startParserState) . tabFilter tabStop .
561+ reader startParserState .
561− fromUTF8 . (joinWithSep "\n")
563+ joinWithSep "\n"
564 readSources [] = mapM readSource ["-"]
566 readSources [] = mapM readSource ["-"]