Dokuwiki writer: More idiomatic code for escaping.

This commit is contained in:
John MacFarlane 2014-07-13 15:32:16 -07:00
parent 798c57d9b2
commit fbf7cbfdc8

View file

@ -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