git.iko.soy/typeable/pandoc
on master help sign in
Stop plain text // becoming an italic marker in dokuwiki writer (#386)
b5b622fclaremacrae
src/Text/Pandoc/Writers/DokuWiki.hs+2−3
@@ -87,8 +87,7 @@ pandocToDokuWiki opts (Pandoc meta blocks) = do
87
87
88-- | Escape special characters for MediaWiki.
88-- | Escape special characters for MediaWiki.
89escapeString :: String -> String
89escapeString :: String -> String
90−-- The spaces around // are to prevent touching in URLs inside inline code blocks
91−escapeString str = substitute " // " " %%//%% " str
90+escapeString str = substitute "//" "%%//%%" str
92
91
93-- | Convert Pandoc block element to DokuWiki.
92-- | Convert Pandoc block element to DokuWiki.
94blockToDokuWiki :: WriterOptions -- ^ Options
93blockToDokuWiki :: WriterOptions -- ^ Options
@@ -423,7 +422,7 @@ inlineToDokuWiki _ (Code _ str) =
423 -- any formatting inside inlined code blocks would be lost, or presented incorrectly.
422 -- any formatting inside inlined code blocks would be lost, or presented incorrectly.
424 return $ "''%%" ++ str ++ "%%''"
423 return $ "''%%" ++ str ++ "%%''"
425
424
426−inlineToDokuWiki _ (Str str) = return $ str
425+inlineToDokuWiki _ (Str str) = return $ escapeString str
427
426
428inlineToDokuWiki _ (Math _ str) = return $ "<math>" ++ str ++ "</math>"
427inlineToDokuWiki _ (Math _ str) = return $ "<math>" ++ str ++ "</math>"
429 -- note: str should NOT be escaped
428 -- note: str should NOT be escaped
tests/dokuwiki-writer.dokuwiki+1−1
@@ -1,3 +1,3 @@
1−hello // world ** from __ me
1+hello %%//%% world ** from __ me
2
2
3''%%hello // world ** from __ me%%''
3''%%hello // world ** from __ me%%''