@@ -39,12 +39,18 @@ inline links:
3939
4040> module Main where
4141> import Text.Pandoc
42+> import Data.Text (Text)
43+> import qualified Data.Text.IO as T
4244>
43−> markdownToRST :: String -> Either PandocError String
44−> markdownToRST =
45−> writeRST def {writerReferenceLinks = True} . readMarkdown def
45+> mdToRST :: Text -> IO Text
46+> mdToRST txt = runIOorExplode $
47+> readMarkdown def txt
48+> >>= writeRST def{ writerReferenceLinks = True }
49+
4650>
47−> main = getContents >>= either error return markdownToRST >>= putStrLn
51+> main :: IO ()
52+> main = do
53+> T.getContents >>= mdToRST >>= T.putStrLn
4854
4955Note: all of the readers assume that the input text has @'\n'@
5056line endings. So if you get your input text from a web form,