git.iko.soy/typeable/pandoc
on master help sign in
Removed incorrect entity conversion in dokuwiki writer (#386)
b5f86a6claremacrae
src/Text/Pandoc/Writers/DokuWiki.hs+3−4
@@ -31,7 +31,6 @@ DokuWiki: <https://www.dokuwiki.org/dokuwiki>
31-}
31-}
32
32
33{-
33{-
34− [ ] Don't convert & to &amp;
35 [ ] Don't generate <blockquote>...
34 [ ] Don't generate <blockquote>...
36 [ ] Don't generate <pre>...
35 [ ] Don't generate <pre>...
37 [ ] Implement definition lists
36 [ ] Implement definition lists
@@ -51,7 +50,7 @@ import Text.Pandoc.Options
51import Text.Pandoc.Shared
50import Text.Pandoc.Shared
52import Text.Pandoc.Writers.Shared
51import Text.Pandoc.Writers.Shared
53import Text.Pandoc.Templates (renderTemplate')
52import Text.Pandoc.Templates (renderTemplate')
54−import Text.Pandoc.XML ( escapeStringForXML )
53+import Text.Pandoc.XML ( escapeStringForXML ) -- TODO Remove this line
55import Data.List ( intersect, intercalate )
54import Data.List ( intersect, intercalate )
56import Network.URI ( isURI )
55import Network.URI ( isURI )
57import Control.Monad.State
56import Control.Monad.State
@@ -89,7 +88,7 @@ pandocToDokuWiki opts (Pandoc meta blocks) = do
89 else return main
88 else return main
90
89
91-- | Escape special characters for DokuWiki.
90-- | Escape special characters for DokuWiki.
92−escapeString :: String -> String
91+escapeString :: String -> String -- TODO Remove this
93escapeString = escapeStringForXML
92escapeString = escapeStringForXML
94
93
95-- | Convert Pandoc block element to DokuWiki.
94-- | Convert Pandoc block element to DokuWiki.
@@ -404,7 +403,7 @@ inlineToDokuWiki opts (Cite _ lst) = inlineListToDokuWiki opts lst
404inlineToDokuWiki _ (Code _ str) =
403inlineToDokuWiki _ (Code _ str) =
405 return $ "<code>" ++ (escapeString str) ++ "</code>"
404 return $ "<code>" ++ (escapeString str) ++ "</code>"
406
405
407−inlineToDokuWiki _ (Str str) = return $ escapeString str
406+inlineToDokuWiki _ (Str str) = return $ str
408
407
409inlineToDokuWiki _ (Math _ str) = return $ "<math>" ++ str ++ "</math>"
408inlineToDokuWiki _ (Math _ str) = return $ "<math>" ++ str ++ "</math>"
410 -- note: str should NOT be escaped
409 -- note: str should NOT be escaped
tests/writer.dokuwiki+8−8
@@ -64,7 +64,7 @@ Nested block quotes:
64</blockquote>
64</blockquote>
65<blockquote>nested
65<blockquote>nested
66</blockquote></blockquote>
66</blockquote></blockquote>
67−This should not be a block quote: 2 &gt; 1.
67+This should not be a block quote: 2 > 1.
68
68
69And a following paragraph.
69And a following paragraph.
70
70
@@ -501,15 +501,15 @@ Here is some unicode:
501 * set membership: ∈
501 * set membership: ∈
502 * copyright: ©
502 * copyright: ©
503
503
504−AT&amp;T has an ampersand in their name.
504+AT&T has an ampersand in their name.
505
505
506−AT&amp;T is another way to write it.
506+AT&T is another way to write it.
507
507
508−This &amp; that.
508+This & that.
509
509
510−4 &lt; 5.
510+4 < 5.
511
511
512−6 &gt; 5.
512+6 > 5.
513
513
514Backslash: \
514Backslash: \
515
515
@@ -531,7 +531,7 @@ Left paren: (
531
531
532Right paren: )
532Right paren: )
533
533
534−Greater-than: &gt;
534+Greater-than: >
535
535
536Hash: #
536Hash: #
537
537
@@ -597,7 +597,7 @@ Foo [[url/|biz]].
597
597
598Here’s a [[http://example.com/?foo=1&bar=2|link with an ampersand in the URL]].
598Here’s a [[http://example.com/?foo=1&bar=2|link with an ampersand in the URL]].
599
599
600−Here’s a link with an amersand in the link text: [[http://att.com/|AT&amp;T]].
600+Here’s a link with an amersand in the link text: [[http://att.com/|AT&T]].
601
601
602Here’s an [[script?foo=1&bar=2|inline link]].
602Here’s an [[script?foo=1&bar=2|inline link]].
603
603