summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll
diff options
context:
space:
mode:
authorSebastian Schwarz <seschwar@googlemail.com>2010-01-19 00:18:55 +0100
committerSebastian Schwarz <seschwar@googlemail.com>2010-01-19 00:18:55 +0100
commit271e7a386d9f49c2e8125ab8f3cfb440efca7eb4 (patch)
treee278775f34c06178408119e7ee2126832e2d2026 /src/Text/Hakyll
parent8da35f6c6df6f947506fa4fa2f3705c88b9f56ab (diff)
downloadhakyll-271e7a386d9f49c2e8125ab8f3cfb440efca7eb4.tar.gz
Enable Pandoc's smart typography parsing.
Something like: -- to &ndash; and ... to &hellip;
Diffstat (limited to 'src/Text/Hakyll')
-rw-r--r--src/Text/Hakyll/Page.hs6
1 files changed, 5 insertions, 1 deletions
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