git.iko.soy/typeable/pandoc
on master help sign in
Implement <code> blocks in dokuwiki writer (#386)
commit573bd1b61b58e66c1e0ecfb4e74928a9d9d27daf authorclaremacrae <github@cfmacrae.fastmail.co.uk> dateSat 17 Aug 2013, 11:20 (13 years ago) parenteb4fe5e
2 files changed+16−17
src/Text/Pandoc/Writers/DokuWiki.hs+1−2 tests/writer.dokuwiki+15−15
src/Text/Pandoc/Writers/DokuWiki.hs+1−2
@@ -32,7 +32,6 @@ DokuWiki: <https://www.dokuwiki.org/dokuwiki>
3232
3333{-
3434 [ ] Don't generate <blockquote>...
35− [ ] Don't generate <pre>...
3635 [ ] Implement definition lists
3736 [ ] Don't generate lists using <ol> and <ul>
3837 [ ] Don't generate <div>
@@ -142,7 +141,7 @@ blockToDokuWiki _ (CodeBlock (_,classes,_) str) = do
142141 "smalltalk", "smarty", "sql", "tcl", "", "thinbasic", "tsql", "vb", "vbnet", "vhdl",
143142 "visualfoxpro", "winbatch", "xml", "xpp", "z80"]
144143 let (beg, end) = if null at
145− then ("<pre" ++ if null classes then ">" else " class=\"" ++ unwords classes ++ "\">", "</pre>")
144+ then ("<code" ++ if null classes then ">" else " class=\"" ++ unwords classes ++ "\">", "</code>")
146145 else ("<source lang=\"" ++ head at ++ "\">", "</source>")
147146 return $ beg ++ escapeString str ++ end
148147
tests/writer.dokuwiki+15−15
@@ -50,9 +50,9 @@ E-mail style:
5050</blockquote>
5151<blockquote>Code in a block quote:
5252
53−<pre>sub status {
53+<code>sub status {
5454 print &quot;working&quot;;
55−}</pre>
55+}</code>
5656A list:
5757
5858 - item one
@@ -75,18 +75,18 @@ And a following paragraph.
7575
7676Code:
7777
78−<pre>---- (should be four hyphens)
78+<code>---- (should be four hyphens)
7979
8080sub status {
8181 print &quot;working&quot;;
8282}
8383
84−this code block is indented by one tab</pre>
84+this code block is indented by one tab</code>
8585And:
8686
87−<pre> this code block is indented by two tabs
87+<code> this code block is indented by two tabs
8888
89−These should not be escaped: \$ \\ \&gt; \[ \{</pre>
89+These should not be escaped: \$ \\ \&gt; \[ \{</code>
9090
9191----
9292
@@ -276,7 +276,7 @@ Multiple blocks with italics:
276276<p>contains seeds, crisp, pleasant to taste</p></dd>
277277<dt>//orange//</dt>
278278<dd><p>orange fruit</p>
279−<pre>{ orange code block }</pre>
279+<code>{ orange code block }</code>
280280<blockquote><p>orange block quote</p></blockquote></dd></dl>
281281
282282Multiple definitions, tight:
@@ -352,12 +352,12 @@ foo
352352
353353This should be a code block, though:
354354
355−<pre>&lt;div&gt;
355+<code>&lt;div&gt;
356356 foo
357−&lt;/div&gt;</pre>
357+&lt;/div&gt;</code>
358358As should this:
359359
360−<pre>&lt;div&gt;foo&lt;/div&gt;</pre>
360+<code>&lt;div&gt;foo&lt;/div&gt;</code>
361361Now, nested:
362362
363363<div>
@@ -386,14 +386,14 @@ Blah
386386
387387Code block:
388388
389−<pre>&lt;!-- Comment --&gt;</pre>
389+<code>&lt;!-- Comment --&gt;</code>
390390Just plain comment, with trailing spaces on the line:
391391
392392<!-- foo -->
393393
394394Code:
395395
396−<pre>&lt;hr /&gt;</pre>
396+<code>&lt;hr /&gt;</code>
397397Hr’s:
398398
399399<hr>
@@ -588,7 +588,7 @@ Indented [[url|thrice]].
588588
589589This should [not][] be a link.
590590
591−<pre>[not]: /url</pre>
591+<code>[not]: /url</code>
592592Foo [[url/|bar]].
593593
594594Foo [[url/|biz]].
@@ -617,7 +617,7 @@ An e-mail address: [[mailto:nobody@nowhere.net|nobody@nowhere.net]]
617617</blockquote>
618618Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code>
619619
620−<pre>or here: &lt;http://example.com/&gt;</pre>
620+<code>or here: &lt;http://example.com/&gt;</code>
621621
622622----
623623
@@ -639,7 +639,7 @@ Here is a footnote reference,((Here is the footnote. It can go anywhere after th
639639
640640Subsequent blocks are indented to show that they belong to the footnote (as with list items).
641641
642−<pre> { &lt;code&gt; }</pre>
642+<code> { &lt;code&gt; }</code>
643643If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
644644)) 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].
645645))