aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/DokuWiki.hs10
-rw-r--r--test/command/3824.md14
2 files changed, 22 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs
index ad8689e8c..279475a21 100644
--- a/src/Text/Pandoc/Writers/DokuWiki.hs
+++ b/src/Text/Pandoc/Writers/DokuWiki.hs
@@ -282,11 +282,16 @@ listAttribsToString (startnum, numstyle, _) =
listItemToDokuWiki :: PandocMonad m
=> WriterOptions -> [Block] -> DokuWiki m String
listItemToDokuWiki opts items = do
- contents <- blockListToDokuWiki opts items
useTags <- stUseTags <$> ask
if useTags
- then return $ "<HTML><li></HTML>" ++ contents ++ "<HTML></li></HTML>"
+ then do
+ contents <- blockListToDokuWiki opts items
+ return $ "<HTML><li></HTML>" ++ contents ++ "<HTML></li></HTML>"
else do
+ bs <- mapM (blockToDokuWiki opts) items
+ let contents = case items of
+ [_, CodeBlock _ _] -> concat bs
+ _ -> vcat bs
indent <- stIndent <$> ask
backSlash <- stBackSlashLB <$> ask
let indent' = if backSlash then (drop 2 indent) else indent
@@ -351,6 +356,7 @@ isSimpleListItem [x, y] | isPlainOrPara x =
BulletList _ -> isSimpleList y
OrderedList _ _ -> isSimpleList y
DefinitionList _ -> isSimpleList y
+ CodeBlock _ _ -> True
_ -> False
isSimpleListItem _ = False
diff --git a/test/command/3824.md b/test/command/3824.md
new file mode 100644
index 000000000..e479e9e2f
--- /dev/null
+++ b/test/command/3824.md
@@ -0,0 +1,14 @@
+```
+% pandoc -f native -t dokuwiki
+[BulletList
+ [[Para [Str "hi"]
+ ,CodeBlock ("",[],[]) " there"]
+ ,[Para [Str "ok"]]]]
+^D
+ * hi<code>
+ there
+</code>
+ * ok
+
+
+```