diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-04-14 18:31:28 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-04-14 18:31:28 -0700 |
commit | 7c3e2670a8707e0fd3a5ccba781c8c676ea68e54 (patch) | |
tree | c9899ebb98ac3458631a92b097030425388e8e88 /src | |
parent | 0fdb310425075cbc2650bf079cd2a1780692ee7b (diff) | |
download | pandoc-7c3e2670a8707e0fd3a5ccba781c8c676ea68e54.tar.gz |
Implemented itemizedlist in docbook reader.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 8 |
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 |