aboutsummaryrefslogtreecommitdiff
path: root/trypandoc
diff options
context:
space:
mode:
Diffstat (limited to 'trypandoc')
-rw-r--r--trypandoc/trypandoc.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/trypandoc/trypandoc.hs b/trypandoc/trypandoc.hs
index b8b821883..5a4828877 100644
--- a/trypandoc/trypandoc.hs
+++ b/trypandoc/trypandoc.hs
@@ -3,15 +3,15 @@ module Main where
import Network.Wai.Handler.CGI
import Network.Wai
import Control.Applicative ((<$>))
-import Data.Maybe (mapMaybe, fromMaybe)
+import Data.Maybe (fromMaybe)
import Network.HTTP.Types.Status (status200)
import Network.HTTP.Types.Header (hContentType)
import Network.HTTP.Types.URI (queryToQueryText)
import Text.Pandoc
+import Text.Pandoc.Writers.Math (defaultMathJaxURL)
import Text.Pandoc.Highlighting (pygments)
import Text.Pandoc.Readers (getReader, Reader(..))
import Text.Pandoc.Writers (getWriter, Writer(..))
-import Text.Pandoc.Error (PandocError)
import Text.Pandoc.Shared (tabFilter)
import Data.Aeson
import qualified Data.Text as T
@@ -29,11 +29,13 @@ app req respond = do
fromFormat <- fromMaybe "" <$> getParam "from"
toFormat <- fromMaybe "" <$> getParam "to"
let reader = case getReader (T.unpack fromFormat) of
- Right (TextReader r) -> r readerOpts
+ Right (TextReader r, es) -> r readerOpts{
+ readerExtensions = es }
_ -> error $ "could not find reader for "
++ T.unpack fromFormat
let writer = case getWriter (T.unpack toFormat) of
- Right (TextWriter w) -> w writerOpts
+ Right (TextWriter w, es) -> w writerOpts{
+ writerExtensions = es }
_ -> error $ "could not find writer for " ++
T.unpack toFormat
let result = case runPure $ reader (tabFilter 4 text) >>= writer of