@@ -85,6 +85,11 @@ pandocToDokuWiki opts (Pandoc meta blocks) = do
8585 then return $ renderTemplate' (writerTemplate opts) context
8686 else return main
8787
88+-- | Escape special characters for MediaWiki.
89+escapeString :: String -> String
90+-- The spaces around // are to prevent touching in URLs inside inline code blocks
91+escapeString str = substitute " // " " %%//%% " str
92+
8893-- | Convert Pandoc block element to DokuWiki.
8994blockToDokuWiki :: WriterOptions -- ^ Options
9095 -> Block -- ^ Block element
@@ -407,7 +412,7 @@ inlineToDokuWiki opts (Quoted DoubleQuote lst) = do
407412inlineToDokuWiki opts (Cite _ lst) = inlineListToDokuWiki opts lst
408413
409414inlineToDokuWiki _ (Code _ str) =
410− return $ "''" ++ str++ "''"
415+ return $ "''" ++ ( escapeString str ) ++ "''"
411416
412417inlineToDokuWiki _ (Str str) = return $ str
413418