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.
This commit is contained in:
parent
6d484bc55e
commit
b5b622f5b8
2 changed files with 3 additions and 4 deletions
|
@ -87,8 +87,7 @@ pandocToDokuWiki opts (Pandoc meta blocks) = do
|
|||
|
||||
-- | 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
|
||||
escapeString str = substitute "//" "%%//%%" str
|
||||
|
||||
-- | Convert Pandoc block element to DokuWiki.
|
||||
blockToDokuWiki :: WriterOptions -- ^ Options
|
||||
|
@ -423,7 +422,7 @@ inlineToDokuWiki _ (Code _ str) =
|
|||
-- any formatting inside inlined code blocks would be lost, or presented incorrectly.
|
||||
return $ "''%%" ++ str ++ "%%''"
|
||||
|
||||
inlineToDokuWiki _ (Str str) = return $ str
|
||||
inlineToDokuWiki _ (Str str) = return $ escapeString str
|
||||
|
||||
inlineToDokuWiki _ (Math _ str) = return $ "<math>" ++ str ++ "</math>"
|
||||
-- note: str should NOT be escaped
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
hello // world ** from __ me
|
||||
hello %%//%% world ** from __ me
|
||||
|
||||
''%%hello // world ** from __ me%%''
|
||||
|
|
Loading…
Reference in a new issue