git.iko.soy/typeable/pandoc
on master help sign in
Don't add entities in <code> blocks in dokuwiki writer (#386)
4c48433claremacrae
src/Text/Pandoc/Writers/DokuWiki.hs+1−1
@@ -143,7 +143,7 @@ blockToDokuWiki _ (CodeBlock (_,classes,_) str) = do
143 let (beg, end) = if null at
143 let (beg, end) = if null at
144 then ("<code" ++ if null classes then ">" else " class=\"" ++ unwords classes ++ "\">", "</code>")
144 then ("<code" ++ if null classes then ">" else " class=\"" ++ unwords classes ++ "\">", "</code>")
145 else ("<source lang=\"" ++ head at ++ "\">", "</source>")
145 else ("<source lang=\"" ++ head at ++ "\">", "</source>")
146− return $ beg ++ escapeString str ++ end
146+ return $ beg ++ str ++ end
147
147
148blockToDokuWiki opts (BlockQuote blocks) = do
148blockToDokuWiki opts (BlockQuote blocks) = do
149 contents <- blockListToDokuWiki opts blocks
149 contents <- blockListToDokuWiki opts blocks
tests/writer.dokuwiki+10−10
@@ -51,7 +51,7 @@ E-mail style:
51<blockquote>Code in a block quote:
51<blockquote>Code in a block quote:
52
52
53<code>sub status {
53<code>sub status {
54− print &quot;working&quot;;
54+ print "working";
55}</code>
55}</code>
56A list:
56A list:
57
57
@@ -78,7 +78,7 @@ Code:
78<code>---- (should be four hyphens)
78<code>---- (should be four hyphens)
79
79
80sub status {
80sub status {
81− print &quot;working&quot;;
81+ print "working";
82}
82}
83
83
84this code block is indented by one tab</code>
84this code block is indented by one tab</code>
@@ -86,7 +86,7 @@ And:
86
86
87<code> this code block is indented by two tabs
87<code> this code block is indented by two tabs
88
88
89−These should not be escaped: \$ \\ \&gt; \[ \{</code>
89+These should not be escaped: \$ \\ \> \[ \{</code>
90
90
91----
91----
92
92
@@ -352,12 +352,12 @@ foo
352
352
353This should be a code block, though:
353This should be a code block, though:
354
354
355−<code>&lt;div&gt;
355+<code><div>
356 foo
356 foo
357−&lt;/div&gt;</code>
357+</div></code>
358As should this:
358As should this:
359
359
360−<code>&lt;div&gt;foo&lt;/div&gt;</code>
360+<code><div>foo</div></code>
361Now, nested:
361Now, nested:
362
362
363<div>
363<div>
@@ -386,14 +386,14 @@ Blah
386
386
387Code block:
387Code block:
388
388
389−<code>&lt;!-- Comment --&gt;</code>
389+<code><!-- Comment --></code>
390Just plain comment, with trailing spaces on the line:
390Just plain comment, with trailing spaces on the line:
391
391
392<!-- foo -->
392<!-- foo -->
393
393
394Code:
394Code:
395
395
396−<code>&lt;hr /&gt;</code>
396+<code><hr /></code>
397Hr’s:
397Hr’s:
398
398
399<hr>
399<hr>
@@ -617,7 +617,7 @@ An e-mail address: [[mailto:nobody@nowhere.net|nobody@nowhere.net]]
617</blockquote>
617</blockquote>
618Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code>
618Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code>
619
619
620−<code>or here: &lt;http://example.com/&gt;</code>
620+<code>or here: <http://example.com/></code>
621
621
622----
622----
623
623
@@ -639,7 +639,7 @@ Here is a footnote reference,((Here is the footnote. It can go anywhere after th
639
639
640Subsequent blocks are indented to show that they belong to the footnote (as with list items).
640Subsequent blocks are indented to show that they belong to the footnote (as with list items).
641
641
642−<code> { &lt;code&gt; }</code>
642+<code> { <code> }</code>
643If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
643If 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 <code>]</code> verbatim characters, as well as [bracketed text].
645))
645))