aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-07-13 15:32:16 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-07-13 15:32:16 -0700
commitfbf7cbfdc8842e30efa082b2a7651d2341358656 (patch)
tree3ae792003e96e73ea24adfcba9e8d08362ae1e4f
parent798c57d9b2c75d2dde3d343e3a49c93664730630 (diff)
downloadpandoc-fbf7cbfdc8842e30efa082b2a7651d2341358656.tar.gz
Dokuwiki writer: More idiomatic code for escaping.
-rw-r--r--src/Text/Pandoc/Writers/DokuWiki.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs
index 47c583f05..9f748ffe5 100644
--- a/src/Text/Pandoc/Writers/DokuWiki.hs
+++ b/src/Text/Pandoc/Writers/DokuWiki.hs
@@ -81,9 +81,11 @@ pandocToDokuWiki opts (Pandoc meta blocks) = do
then return $ renderTemplate' (writerTemplate opts) context
else return main
--- | Escape special characters for MediaWiki.
+-- | Escape special characters for DokuWiki.
escapeString :: String -> String
-escapeString str = substitute "__" "%%__%%" ( substitute "**" "%%**%%" ( substitute "//" "%%//%%" str ) )
+escapeString = substitute "__" "%%__%%" .
+ substitute "**" "%%**%%" .
+ substitute "//" "%%//%%"
-- | Convert Pandoc block element to DokuWiki.
blockToDokuWiki :: WriterOptions -- ^ Options