Remove stray <div> and </div> from DokuWiki output (#386)

This commit is contained in:
Clare Macrae
2014-07-01 21:42:21 +01:00
parent 0727579167
commit 244c4eee74
2 changed files with 11 additions and 23 deletions
+2 -5
View File
@@ -34,7 +34,6 @@ DokuWiki: <https://www.dokuwiki.org/dokuwiki>
[ ] Correct handling of Span
[ ] Don't generate <blockquote>...
[ ] Don't generate lists using <ol> and <ul>
[ ] Don't generate <div>
[ ] Implement alignment of text in tables
[ ] Implement comments
[ ] Work through the Dokuwiki spec, and check I've not missed anything out
@@ -47,7 +46,6 @@ import Text.Pandoc.Definition
import Text.Pandoc.Options
import Text.Pandoc.Shared
import Text.Pandoc.Writers.Shared
import Text.Pandoc.Pretty (render)
import Text.Pandoc.Templates (renderTemplate')
import Data.List ( intersect, intercalate )
import Network.URI ( isURI )
@@ -97,10 +95,9 @@ blockToDokuWiki :: WriterOptions -- ^ Options
blockToDokuWiki _ Null = return ""
blockToDokuWiki opts (Div attrs bs) = do
blockToDokuWiki opts (Div _attrs bs) = do
contents <- blockListToDokuWiki opts bs
return $ render Nothing (tagWithAttrs "div" attrs) ++ "\n" ++
contents ++ "\n" ++ "</div>"
return $ contents ++ "\n"
blockToDokuWiki opts (Plain inlines) =
inlineListToDokuWiki opts inlines
+9 -18
View File
@@ -274,21 +274,16 @@ Blank line after term, indented marker, alternate markers:
Simple block on one line:
<div>
foo
</div>
And nested without indentation:
<div>
<div>
<div>
foo
</div>
</div>
<div>
bar
</div>
</div>
Interpreted markdown in a table:
<html>
@@ -309,9 +304,8 @@ And this is **strong**
</html>
Here’s a simple block:
<div>
foo
</div>
This should be a code block, though:
<code><div>
@@ -322,13 +316,10 @@ As should this:
<code><div>foo</div></code>
Now, nested:
<div>
<div>
<div>
foo
</div>
</div>
</div>
This should just be an HTML comment:
<html>