diff options
author | Clare Macrae <github@cfmacrae.fastmail.co.uk> | 2014-07-01 21:21:09 +0100 |
---|---|---|
committer | Clare Macrae <github@cfmacrae.fastmail.co.uk> | 2014-07-01 21:21:09 +0100 |
commit | 072757916754a11cc7837d343c5c63ee1585a35b (patch) | |
tree | 6ed7ed089e2049ac564acc795ae8e1cf8da7b950 | |
parent | a049a60129fe12b2b9132d36c9990dbbca3fd4c8 (diff) |
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.
-rw-r--r-- | src/Text/Pandoc/Writers/DokuWiki.hs | 2 | ||||
-rw-r--r-- | tests/writer.dokuwiki | 21 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index ce8efb281..ad68425ff 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -126,7 +126,7 @@ blockToDokuWiki opts (Para inlines) = do blockToDokuWiki _ (RawBlock f str) | f == Format "mediawiki" = return str - | f == Format "html" = return str + | f == Format "html" = return $ "<html>\n" ++ str ++ "</html>" | otherwise = return "" blockToDokuWiki _ HorizontalRule = return "\n----\n" diff --git a/tests/writer.dokuwiki b/tests/writer.dokuwiki index b60e57f07..c18e95128 100644 --- a/tests/writer.dokuwiki +++ b/tests/writer.dokuwiki @@ -291,19 +291,22 @@ bar </div> Interpreted markdown in a table: +<html> <table> <tr> -<td> +<td></html> This is //emphasized// +<html> </td> -<td> +<td></html> And this is **strong** +<html> </td> </tr> </table> <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script> - +</html> Here’s a simple block: <div> @@ -328,10 +331,12 @@ foo </div> This should just be an HTML comment: +<html> <!-- Comment --> - +</html> Multiline: +<html> <!-- Blah Blah @@ -340,19 +345,21 @@ Blah <!-- This is another comment. --> - +</html> Code block: <code><!-- Comment --></code> Just plain comment, with trailing spaces on the line: +<html> <!-- foo --> - +</html> Code: <code><hr /></code> Hr’s: +<html> <hr> <hr /> @@ -370,7 +377,7 @@ Hr’s: <hr class="foo" id="bar" /> <hr class="foo" id="bar"> - +</html> ---- |