git.iko.soy/typeable/pandoc
on master help sign in
Fixed inlined code in dokuwiki writer (#386)
commit0961d499121e20473dfc02cfd1d7282f89436700 authorclaremacrae <github@cfmacrae.fastmail.co.uk> dateSat 17 Aug 2013, 12:34 (13 years ago) parent4c48433
2 files changed+7−12
src/Text/Pandoc/Writers/DokuWiki.hs+1−6 tests/writer.dokuwiki+6−6
src/Text/Pandoc/Writers/DokuWiki.hs+1−6
@@ -48,7 +48,6 @@ import Text.Pandoc.Options
4848import Text.Pandoc.Shared
4949import Text.Pandoc.Writers.Shared
5050import Text.Pandoc.Templates (renderTemplate')
51−import Text.Pandoc.XML ( escapeStringForXML ) -- TODO Remove this line
5251import Data.List ( intersect, intercalate )
5352import Network.URI ( isURI )
5453import Control.Monad.State
@@ -86,10 +85,6 @@ pandocToDokuWiki opts (Pandoc meta blocks) = do
8685 then return $ renderTemplate' (writerTemplate opts) context
8786 else return main
8887
89−-- | Escape special characters for DokuWiki.
90−escapeString :: String -> String -- TODO Remove this
91−escapeString = escapeStringForXML
92−
9388-- | Convert Pandoc block element to DokuWiki.
9489blockToDokuWiki :: WriterOptions -- ^ Options
9590 -> Block -- ^ Block element
@@ -412,7 +407,7 @@ inlineToDokuWiki opts (Quoted DoubleQuote lst) = do
412407inlineToDokuWiki opts (Cite _ lst) = inlineListToDokuWiki opts lst
413408
414409inlineToDokuWiki _ (Code _ str) =
415− return $ "<code>" ++ (escapeString str) ++ "</code>"
410+ return $ "''" ++ str++ "''"
416411
417412inlineToDokuWiki _ (Str str) = return $ str
418413
tests/writer.dokuwiki+6−6
@@ -433,7 +433,7 @@ So is **//this//** word.
433433
434434So is **//this//** word.
435435
436−This is code: <code>&gt;</code>, <code>$</code>, <code>\</code>, <code>\$</code>, <code>&lt;html&gt;</code>.
436+This is code: ''>'', ''$'', ''\'', ''\$'', ''<html>''.
437437
438438<del>This is //strikeout//.</del>
439439
@@ -456,7 +456,7 @@ These should not be superscripts or subscripts, because of the unescaped spaces:
456456
457457‘He said, “I want to go.”’ Were you alive in the 70’s?
458458
459−Here is some quoted ‘<code>code</code>’ and a “[[http://example.com/?foo=1&bar=2|quoted link]]”.
459+Here is some quoted ‘''code''’ and a “[[http://example.com/?foo=1&bar=2|quoted link]]”.
460460
461461Some dashes: one—two — three—four — five.
462462
@@ -480,10 +480,10 @@ Ellipses…and…and….
480480
481481These shouldn’t be math:
482482
483− * To get the famous equation, write <code>$e = mc^2$</code>.
483+ * To get the famous equation, write ''$e = mc^2$''.
484484 * $22,000 is a //lot// of money. So is $34,000. (It worked if “lot” is emphasized.)
485485 * Shoes ($20) and socks ($5).
486− * Escaped <code>$</code>: $73 //this should be emphasized// 23$.
486+ * Escaped ''$'': $73 //this should be emphasized// 23$.
487487
488488Here’s a LaTeX table:
489489
@@ -615,7 +615,7 @@ An e-mail address: [[mailto:nobody@nowhere.net|nobody@nowhere.net]]
615615
616616<blockquote>Blockquoted: http://example.com/
617617</blockquote>
618−Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code>
618+Auto-links should not occur here: ''<http://example.com/>''
619619
620620<code>or here: <http://example.com/></code>
621621
@@ -641,7 +641,7 @@ Subsequent blocks are indented to show that they belong to the footnote (as with
641641
642642<code> { <code> }</code>
643643If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
644−)) This should //not// be a footnote reference, because it contains a space.[^my note] Here is an inline note.((This is //easier// to type. Inline notes may contain [[http://google.com|links]] and <code>]</code> verbatim characters, as well as [bracketed text].
644+)) This should //not// be a footnote reference, because it contains a space.[^my note] Here is an inline note.((This is //easier// to type. Inline notes may contain [[http://google.com|links]] and '']'' verbatim characters, as well as [bracketed text].
645645))
646646
647647<blockquote>Notes can go in quotes.((In quote.