diff options
author | claremacrae <github@cfmacrae.fastmail.co.uk> | 2013-08-17 11:20:51 +0100 |
---|---|---|
committer | claremacrae <github@cfmacrae.fastmail.co.uk> | 2013-08-17 11:20:51 +0100 |
commit | 573bd1b61b58e66c1e0ecfb4e74928a9d9d27daf (patch) | |
tree | 6c4acb9799c1e170d22b837c014cb5579846c3ae | |
parent | eb4fe5e82c65b5dc2f5689e4b1bceff0179397b5 (diff) | |
download | pandoc-573bd1b61b58e66c1e0ecfb4e74928a9d9d27daf.tar.gz |
Implement <code> blocks in dokuwiki writer (#386)
-rw-r--r-- | src/Text/Pandoc/Writers/DokuWiki.hs | 3 | ||||
-rw-r--r-- | tests/writer.dokuwiki | 30 |
2 files changed, 16 insertions, 17 deletions
diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index 76fe2fa36..97b1705d1 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -32,7 +32,6 @@ DokuWiki: <https://www.dokuwiki.org/dokuwiki> {- [ ] Don't generate <blockquote>... - [ ] Don't generate <pre>... [ ] Implement definition lists [ ] Don't generate lists using <ol> and <ul> [ ] Don't generate <div> @@ -142,7 +141,7 @@ blockToDokuWiki _ (CodeBlock (_,classes,_) str) = do "smalltalk", "smarty", "sql", "tcl", "", "thinbasic", "tsql", "vb", "vbnet", "vhdl", "visualfoxpro", "winbatch", "xml", "xpp", "z80"] let (beg, end) = if null at - then ("<pre" ++ if null classes then ">" else " class=\"" ++ unwords classes ++ "\">", "</pre>") + then ("<code" ++ if null classes then ">" else " class=\"" ++ unwords classes ++ "\">", "</code>") else ("<source lang=\"" ++ head at ++ "\">", "</source>") return $ beg ++ escapeString str ++ end diff --git a/tests/writer.dokuwiki b/tests/writer.dokuwiki index 9063ab917..b9a8a3c05 100644 --- a/tests/writer.dokuwiki +++ b/tests/writer.dokuwiki @@ -50,9 +50,9 @@ E-mail style: </blockquote> <blockquote>Code in a block quote: -<pre>sub status { +<code>sub status { print "working"; -}</pre> +}</code> A list: - item one @@ -75,18 +75,18 @@ And a following paragraph. Code: -<pre>---- (should be four hyphens) +<code>---- (should be four hyphens) sub status { print "working"; } -this code block is indented by one tab</pre> +this code block is indented by one tab</code> And: -<pre> this code block is indented by two tabs +<code> this code block is indented by two tabs -These should not be escaped: \$ \\ \> \[ \{</pre> +These should not be escaped: \$ \\ \> \[ \{</code> ---- @@ -276,7 +276,7 @@ Multiple blocks with italics: <p>contains seeds, crisp, pleasant to taste</p></dd> <dt>//orange//</dt> <dd><p>orange fruit</p> -<pre>{ orange code block }</pre> +<code>{ orange code block }</code> <blockquote><p>orange block quote</p></blockquote></dd></dl> Multiple definitions, tight: @@ -352,12 +352,12 @@ foo This should be a code block, though: -<pre><div> +<code><div> foo -</div></pre> +</div></code> As should this: -<pre><div>foo</div></pre> +<code><div>foo</div></code> Now, nested: <div> @@ -386,14 +386,14 @@ Blah Code block: -<pre><!-- Comment --></pre> +<code><!-- Comment --></code> Just plain comment, with trailing spaces on the line: <!-- foo --> Code: -<pre><hr /></pre> +<code><hr /></code> Hr’s: <hr> @@ -588,7 +588,7 @@ Indented [[url|thrice]]. This should [not][] be a link. -<pre>[not]: /url</pre> +<code>[not]: /url</code> Foo [[url/|bar]]. Foo [[url/|biz]]. @@ -617,7 +617,7 @@ An e-mail address: [[mailto:nobody@nowhere.net|nobody@nowhere.net]] </blockquote> Auto-links should not occur here: <code><http://example.com/></code> -<pre>or here: <http://example.com/></pre> +<code>or here: <http://example.com/></code> ---- @@ -639,7 +639,7 @@ Here is a footnote reference,((Here is the footnote. It can go anywhere after th Subsequent blocks are indented to show that they belong to the footnote (as with list items). -<pre> { <code> }</pre> +<code> { <code> }</code> If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. )) 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]. )) |