aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-04-14 18:31:28 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-04-14 18:31:28 -0700
commit7c3e2670a8707e0fd3a5ccba781c8c676ea68e54 (patch)
treec9899ebb98ac3458631a92b097030425388e8e88 /src/Text/Pandoc/Readers
parent0fdb310425075cbc2650bf079cd2a1780692ee7b (diff)
downloadpandoc-7c3e2670a8707e0fd3a5ccba781c8c676ea68e54.tar.gz
Implemented itemizedlist in docbook reader.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/DocBook.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs
index b40bf32c5..59830c3dd 100644
--- a/src/Text/Pandoc/Readers/DocBook.hs
+++ b/src/Text/Pandoc/Readers/DocBook.hs
@@ -36,7 +36,7 @@ parseBlock (Text (CData _ s _)) = if all isSpace s
parseBlock (Elem e) =
case qName (elName e) of
"para" -> para <$> getInlines e
- "blockquote" -> blockQuote <$> innerBlocks
+ "blockquote" -> blockQuote <$> getBlocks e
"sect1" -> sect 1
"sect2" -> sect 2
"sect3" -> sect 3
@@ -44,17 +44,19 @@ parseBlock (Elem e) =
"sect5" -> sect 5
"sect6" -> sect 6
"section" -> gets dbSectionLevel >>= sect . (+1)
+ "itemizedlist" -> bulletList <$> listitems
"articleinfo" -> getTitle >> getAuthors >> getDate >> return mempty
"title" -> return mempty -- processed by sect
"?xml" -> return mempty
- _ -> innerBlocks
- where innerBlocks = mconcat <$> (mapM parseBlock $ elContent e)
+ _ -> getBlocks e
+ where getBlocks e' = mconcat <$> (mapM parseBlock $ elContent e')
getInlines e' = (trimInlines . mconcat) <$>
(mapM parseInline $ elContent e')
isTitle e' = qName (elName e') == "title"
skipWhite (Text (CData _ s _):xs) | all isSpace s = skipWhite xs
| otherwise = xs
skipWhite xs = xs
+ listitems = mapM getBlocks $ findChildren (unqual "listitem") e
getTitle = case findChild (unqual "title") e of
Just t -> do
tit <- getInlines t