git.iko.soy/typeable/pandoc
on master help sign in
Improved HTML Blocks in DokuWiki output (#386)

For example, this fixes the display of a broken table, and it also fixes the various HTML horizontal rules.

commit072757916754a11cc7837d343c5c63ee1585a35b authorClare Macrae <github@cfmacrae.fastmail.co.uk> dateTue 1 Jul 2014, 21:21 (12 years ago) parenta049a60
2 files changed+15−8
src/Text/Pandoc/Writers/DokuWiki.hs+1−1 tests/writer.dokuwiki+14−7
src/Text/Pandoc/Writers/DokuWiki.hs+1−1
@@ -126,7 +126,7 @@ blockToDokuWiki opts (Para inlines) = do
126126
127127blockToDokuWiki _ (RawBlock f str)
128128 | f == Format "mediawiki" = return str
129− | f == Format "html" = return str
129+ | f == Format "html" = return $ "<html>\n" ++ str ++ "</html>"
130130 | otherwise = return ""
131131
132132blockToDokuWiki _ HorizontalRule = return "\n----\n"
tests/writer.dokuwiki+14−7
@@ -291,19 +291,22 @@ bar
291291</div>
292292Interpreted markdown in a table:
293293
294+<html>
294295<table>
295296<tr>
296−<td>
297+<td></html>
297298This is //emphasized//
299+<html>
298300</td>
299−<td>
301+<td></html>
300302And this is **strong**
303+<html>
301304</td>
302305</tr>
303306</table>
304307
305308<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
306−
309+</html>
307310Here’s a simple block:
308311
309312<div>
@@ -328,10 +331,12 @@ foo
328331</div>
329332This should just be an HTML comment:
330333
334+<html>
331335<!-- Comment -->
332−
336+</html>
333337Multiline:
334338
339+<html>
335340<!--
336341Blah
337342Blah
@@ -340,19 +345,21 @@ Blah
340345<!--
341346 This is another comment.
342347-->
343−
348+</html>
344349Code block:
345350
346351<code><!-- Comment --></code>
347352Just plain comment, with trailing spaces on the line:
348353
354+<html>
349355<!-- foo -->
350−
356+</html>
351357Code:
352358
353359<code><hr /></code>
354360Hr’s:
355361
362+<html>
356363<hr>
357364
358365<hr />
@@ -370,7 +377,7 @@ Hr’s:
370377<hr class="foo" id="bar" />
371378
372379<hr class="foo" id="bar">
373−
380+</html>
374381
375382----
376383