git.iko.soy/typeable/pandoc
on master help sign in
Stop plain text // becoming an italic marker in dokuwiki writer (#386)

When the original document had text containing //, this was previously included, unchanged, in the dokuwiki output, and this interacted badly with later, intended, formating text.

commitb5b622f5b821ed5624b0ce2f29d1bddd0100bd04 authorclaremacrae <github@cfmacrae.fastmail.co.uk> dateSun 18 Aug 2013, 08:57 (13 years ago) parent6d484bc
2 files changed+3−4
src/Text/Pandoc/Writers/DokuWiki.hs+2−3 tests/dokuwiki-writer.dokuwiki+1−1
src/Text/Pandoc/Writers/DokuWiki.hs+2−3
@@ -87,8 +87,7 @@ pandocToDokuWiki opts (Pandoc meta blocks) = do
8787
8888-- | Escape special characters for MediaWiki.
8989escapeString :: 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
9291
9392-- | Convert Pandoc block element to DokuWiki.
9493blockToDokuWiki :: WriterOptions -- ^ Options
@@ -423,7 +422,7 @@ inlineToDokuWiki _ (Code _ str) =
423422 -- any formatting inside inlined code blocks would be lost, or presented incorrectly.
424423 return $ "''%%" ++ str ++ "%%''"
425424
426−inlineToDokuWiki _ (Str str) = return $ str
425+inlineToDokuWiki _ (Str str) = return $ escapeString str
427426
428427inlineToDokuWiki _ (Math _ str) = return $ "<math>" ++ str ++ "</math>"
429428 -- 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
22
33''%%hello // world ** from __ me%%''