git.iko.soy/typeable/pandoc
on master help sign in
Improved HTML Blocks in DokuWiki output (#386)
0727579Clare Macrae
src/Text/Pandoc/Writers/DokuWiki.hs+1−1
@@ -126,7 +126,7 @@ blockToDokuWiki opts (Para inlines) = do
126
126
127blockToDokuWiki _ (RawBlock f str)
127blockToDokuWiki _ (RawBlock f str)
128 | f == Format "mediawiki" = return str
128 | f == Format "mediawiki" = return str
129− | f == Format "html" = return str
129+ | f == Format "html" = return $ "<html>\n" ++ str ++ "</html>"
130 | otherwise = return ""
130 | otherwise = return ""
131
131
132blockToDokuWiki _ HorizontalRule = return "\n----\n"
132blockToDokuWiki _ HorizontalRule = return "\n----\n"
tests/writer.dokuwiki+14−7
@@ -291,19 +291,22 @@ bar
291</div>
291</div>
292Interpreted markdown in a table:
292Interpreted markdown in a table:
293
293
294+<html>
294<table>
295<table>
295<tr>
296<tr>
296−<td>
297+<td></html>
297This is //emphasized//
298This is //emphasized//
299+<html>
298</td>
300</td>
299−<td>
301+<td></html>
300And this is **strong**
302And this is **strong**
303+<html>
301</td>
304</td>
302</tr>
305</tr>
303</table>
306</table>
304
307
305<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
308<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
306−
309+</html>
307Here’s a simple block:
310Here’s a simple block:
308
311
309<div>
312<div>
@@ -328,10 +331,12 @@ foo
328</div>
331</div>
329This should just be an HTML comment:
332This should just be an HTML comment:
330
333
334+<html>
331<!-- Comment -->
335<!-- Comment -->
332−
336+</html>
333Multiline:
337Multiline:
334
338
339+<html>
335<!--
340<!--
336Blah
341Blah
337Blah
342Blah
@@ -340,19 +345,21 @@ Blah
340<!--
345<!--
341 This is another comment.
346 This is another comment.
342-->
347-->
343−
348+</html>
344Code block:
349Code block:
345
350
346<code><!-- Comment --></code>
351<code><!-- Comment --></code>
347Just plain comment, with trailing spaces on the line:
352Just plain comment, with trailing spaces on the line:
348
353
354+<html>
349<!-- foo -->
355<!-- foo -->
350−
356+</html>
351Code:
357Code:
352
358
353<code><hr /></code>
359<code><hr /></code>
354Hr’s:
360Hr’s:
355
361
362+<html>
356<hr>
363<hr>
357
364
358<hr />
365<hr />
@@ -370,7 +377,7 @@ Hr’s:
370<hr class="foo" id="bar" />
377<hr class="foo" id="bar" />
371
378
372<hr class="foo" id="bar">
379<hr class="foo" id="bar">
373−
380+</html>
374
381
375----
382----
376
383