git.iko.soy/typeable/pandoc
on master help sign in
DokuWiki writer: Normalize to collapse adjacent raw HTML blocks.
0ba2f0bJohn MacFarlane
src/Text/Pandoc/Writers/DokuWiki.hs+1−1
@@ -57,7 +57,7 @@ data WriterState = WriterState {
57-- | Convert Pandoc to DokuWiki.
57-- | Convert Pandoc to DokuWiki.
58writeDokuWiki :: WriterOptions -> Pandoc -> String
58writeDokuWiki :: WriterOptions -> Pandoc -> String
59writeDokuWiki opts document =
59writeDokuWiki opts document =
60− evalState (pandocToDokuWiki opts document)
60+ evalState (pandocToDokuWiki opts $ normalize document)
61 (WriterState { stNotes = False, stIndent = "", stUseTags = False })
61 (WriterState { stNotes = False, stIndent = "", stUseTags = False })
62
62
63-- | Return DokuWiki representation of document.
63-- | Return DokuWiki representation of document.
tests/writer.dokuwiki−30
@@ -288,31 +288,19 @@ Interpreted markdown in a table:
288
288
289<HTML>
289<HTML>
290<table>
290<table>
291−</HTML>
292−<HTML>
293<tr>
291<tr>
294−</HTML>
295−<HTML>
296<td>
292<td>
297</HTML>
293</HTML>
298This is //emphasized//
294This is //emphasized//
299<HTML>
295<HTML>
300</td>
296</td>
301−</HTML>
302−<HTML>
303<td>
297<td>
304</HTML>
298</HTML>
305And this is **strong**
299And this is **strong**
306<HTML>
300<HTML>
307</td>
301</td>
308−</HTML>
309−<HTML>
310</tr>
302</tr>
311−</HTML>
312−<HTML>
313</table>
303</table>
314−</HTML>
315−<HTML>
316<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
304<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
317</HTML>
305</HTML>
318Here’s a simple block:
306Here’s a simple block:
@@ -345,8 +333,6 @@ Multiline:
345Blah
333Blah
346Blah
334Blah
347-->
335-->
348−</HTML>
349−<HTML>
350<!--
336<!--
351 This is another comment.
337 This is another comment.
352-->
338-->
@@ -366,29 +352,13 @@ Hr’s:
366
352
367<HTML>
353<HTML>
368<hr>
354<hr>
369−</HTML>
370−<HTML>
371<hr />
355<hr />
372−</HTML>
373−<HTML>
374<hr />
356<hr />
375−</HTML>
376−<HTML>
377<hr>
357<hr>
378−</HTML>
379−<HTML>
380<hr />
358<hr />
381−</HTML>
382−<HTML>
383<hr />
359<hr />
384−</HTML>
385−<HTML>
386<hr class="foo" id="bar" />
360<hr class="foo" id="bar" />
387−</HTML>
388−<HTML>
389<hr class="foo" id="bar" />
361<hr class="foo" id="bar" />
390−</HTML>
391−<HTML>
392<hr class="foo" id="bar">
362<hr class="foo" id="bar">
393</HTML>
363</HTML>
394
364