diff options
author | claremacrae <github@cfmacrae.fastmail.co.uk> | 2013-08-18 08:13:34 +0100 |
---|---|---|
committer | claremacrae <github@cfmacrae.fastmail.co.uk> | 2013-08-18 08:13:34 +0100 |
commit | 6d484bc55e2bc8d318b0727bcd88e4ceea795329 (patch) | |
tree | 672baeca2c6d16524f7e4dc934106bb4e68ff3bb /src/Text/Pandoc/Writers | |
parent | 2a4bbe5d4f433648be8b8ddb6079e5e09153d722 (diff) | |
download | pandoc-6d484bc55e2bc8d318b0727bcd88e4ceea795329.tar.gz |
Treat inline code blocks like <code> instead of <tt> in dokuwiki writer (#386)
Done because I noticed that in the Autolinks section of writer.dokuwiki, the URL in inlined code was getting auto-linked, when it wasn't supposed to.
This also meant that any inline code examples that had text that looked like dokuwiki syntax could break the formatting of later text.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/DokuWiki.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index 9ac35ebd6..a38a54953 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -412,7 +412,16 @@ inlineToDokuWiki opts (Quoted DoubleQuote lst) = do inlineToDokuWiki opts (Cite _ lst) = inlineListToDokuWiki opts lst inlineToDokuWiki _ (Code _ str) = - return $ "''" ++ ( escapeString str ) ++ "''" + -- In dokuwiki, text surrounded by '' is really just a font statement, i.e. <tt>, + -- and so other formatting can be present inside. + -- However, in pandoc, and markdown, inlined code doesn't contain formatting. + -- So I have opted for using %% to disable all formatting inside inline code blocks. + -- This gives the best results when converting from other formats to dokuwiki, even if + -- the resultand code is a little ugly, for short strings that don't contain formatting + -- characters. + -- It does mean that if pandoc could ever read dokuwiki, and so round-trip the format, + -- any formatting inside inlined code blocks would be lost, or presented incorrectly. + return $ "''%%" ++ str ++ "%%''" inlineToDokuWiki _ (Str str) = return $ str |