git.iko.soy/typeable/pandoc
on master help sign in
Removed incorrect entity conversion in dokuwiki writer (#386)
commitb5f86a665d272a76d768ccdc6d7c19b13e884d29 authorclaremacrae <github@cfmacrae.fastmail.co.uk> dateSun 28 Jul 2013, 18:59 (13 years ago) parent51b8ce4
2 files changed+11−12
src/Text/Pandoc/Writers/DokuWiki.hs+3−4 tests/writer.dokuwiki+8−8
src/Text/Pandoc/Writers/DokuWiki.hs+3−4
@@ -31,7 +31,6 @@ DokuWiki: <https://www.dokuwiki.org/dokuwiki>
3131-}
3232
3333{-
34− [ ] Don't convert & to &amp;
3534 [ ] Don't generate <blockquote>...
3635 [ ] Don't generate <pre>...
3736 [ ] Implement definition lists
@@ -51,7 +50,7 @@ import Text.Pandoc.Options
5150import Text.Pandoc.Shared
5251import Text.Pandoc.Writers.Shared
5352import Text.Pandoc.Templates (renderTemplate')
54−import Text.Pandoc.XML ( escapeStringForXML )
53+import Text.Pandoc.XML ( escapeStringForXML ) -- TODO Remove this line
5554import Data.List ( intersect, intercalate )
5655import Network.URI ( isURI )
5756import Control.Monad.State
@@ -89,7 +88,7 @@ pandocToDokuWiki opts (Pandoc meta blocks) = do
8988 else return main
9089
9190-- | Escape special characters for DokuWiki.
92−escapeString :: String -> String
91+escapeString :: String -> String -- TODO Remove this
9392escapeString = escapeStringForXML
9493
9594-- | Convert Pandoc block element to DokuWiki.
@@ -404,7 +403,7 @@ inlineToDokuWiki opts (Cite _ lst) = inlineListToDokuWiki opts lst
404403inlineToDokuWiki _ (Code _ str) =
405404 return $ "<code>" ++ (escapeString str) ++ "</code>"
406405
407−inlineToDokuWiki _ (Str str) = return $ escapeString str
406+inlineToDokuWiki _ (Str str) = return $ str
408407
409408inlineToDokuWiki _ (Math _ str) = return $ "<math>" ++ str ++ "</math>"
410409 -- note: str should NOT be escaped
tests/writer.dokuwiki+8−8
@@ -64,7 +64,7 @@ Nested block quotes:
6464</blockquote>
6565<blockquote>nested
6666</blockquote></blockquote>
67−This should not be a block quote: 2 &gt; 1.
67+This should not be a block quote: 2 > 1.
6868
6969And a following paragraph.
7070
@@ -501,15 +501,15 @@ Here is some unicode:
501501 * set membership: ∈
502502 * copyright: ©
503503
504−AT&amp;T has an ampersand in their name.
504+AT&T has an ampersand in their name.
505505
506−AT&amp;T is another way to write it.
506+AT&T is another way to write it.
507507
508−This &amp; that.
508+This & that.
509509
510−4 &lt; 5.
510+4 < 5.
511511
512−6 &gt; 5.
512+6 > 5.
513513
514514Backslash: \
515515
@@ -531,7 +531,7 @@ Left paren: (
531531
532532Right paren: )
533533
534−Greater-than: &gt;
534+Greater-than: >
535535
536536Hash: #
537537
@@ -597,7 +597,7 @@ Foo [[url/|biz]].
597597
598598Here’s a [[http://example.com/?foo=1&bar=2|link with an ampersand in the URL]].
599599
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]].
601601
602602Here’s an [[script?foo=1&bar=2|inline link]].
603603