From 271e7a386d9f49c2e8125ab8f3cfb440efca7eb4 Mon Sep 17 00:00:00 2001 From: Sebastian Schwarz Date: Tue, 19 Jan 2010 00:18:55 +0100 Subject: Enable Pandoc's smart typography parsing. Something like: -- to – and ... to … --- src/Text/Hakyll/Page.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Hakyll/Page.hs b/src/Text/Hakyll/Page.hs index 41ddba6..b58ea0f 100644 --- a/src/Text/Hakyll/Page.hs +++ b/src/Text/Hakyll/Page.hs @@ -52,6 +52,10 @@ getPagePath (Page page) = getBody :: Page -> String getBody (Page page) = fromMaybe [] $ M.lookup "body" page +-- | The default reader options for pandoc parsing. +readerOptions :: ParserState +readerOptions = defaultParserState { stateSmart = True } + -- | The default writer options for pandoc rendering. writerOptions :: WriterOptions writerOptions = defaultWriterOptions @@ -60,7 +64,7 @@ writerOptions = defaultWriterOptions getRenderFunction :: String -> (String -> String) getRenderFunction ".html" = id getRenderFunction ext = writeHtmlString writerOptions - . readFunction ext defaultParserState + . readFunction ext readerOptions where readFunction ".rst" = readRST readFunction ".tex" = readLaTeX -- cgit v1.2.3