Nasty hack to stop C comments in inline code becoming italics in dokuwiki writer (#386)
This commit is contained in:
parent
84c2c5f01d
commit
2a4bbe5d4f
2 changed files with 7 additions and 2 deletions
|
@ -85,6 +85,11 @@ pandocToDokuWiki opts (Pandoc meta blocks) = do
|
|||
then return $ renderTemplate' (writerTemplate opts) context
|
||||
else return main
|
||||
|
||||
-- | Escape special characters for MediaWiki.
|
||||
escapeString :: String -> String
|
||||
-- The spaces around // are to prevent touching in URLs inside inline code blocks
|
||||
escapeString str = substitute " // " " %%//%% " str
|
||||
|
||||
-- | Convert Pandoc block element to DokuWiki.
|
||||
blockToDokuWiki :: WriterOptions -- ^ Options
|
||||
-> Block -- ^ Block element
|
||||
|
@ -407,7 +412,7 @@ inlineToDokuWiki opts (Quoted DoubleQuote lst) = do
|
|||
inlineToDokuWiki opts (Cite _ lst) = inlineListToDokuWiki opts lst
|
||||
|
||||
inlineToDokuWiki _ (Code _ str) =
|
||||
return $ "''" ++ str++ "''"
|
||||
return $ "''" ++ ( escapeString str ) ++ "''"
|
||||
|
||||
inlineToDokuWiki _ (Str str) = return $ str
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
hello // world ** from __ me
|
||||
|
||||
''hello // world ** from __ me''
|
||||
''hello %%//%% world ** from __ me''
|
||||
|
|
Loading…
Add table
Reference in a new issue