git.iko.soy/typeable/pandoc
on master help sign in
Implemented itemizedlist in docbook reader.
commit7c3e2670a8707e0fd3a5ccba781c8c676ea68e54 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 14 Apr 2012, 18:31 (15 years ago) parent0fdb310
1 file changed+5−3
src/Text/Pandoc/Readers/DocBook.hs+5−3
src/Text/Pandoc/Readers/DocBook.hs+5−3
@@ -36,7 +36,7 @@ parseBlock (Text (CData _ s _)) = if all isSpace s
3636parseBlock (Elem e) =
3737 case qName (elName e) of
3838 "para" -> para <$> getInlines e
39− "blockquote" -> blockQuote <$> innerBlocks
39+ "blockquote" -> blockQuote <$> getBlocks e
4040 "sect1" -> sect 1
4141 "sect2" -> sect 2
4242 "sect3" -> sect 3
@@ -44,17 +44,19 @@ parseBlock (Elem e) =
4444 "sect5" -> sect 5
4545 "sect6" -> sect 6
4646 "section" -> gets dbSectionLevel >>= sect . (+1)
47+ "itemizedlist" -> bulletList <$> listitems
4748 "articleinfo" -> getTitle >> getAuthors >> getDate >> return mempty
4849 "title" -> return mempty -- processed by sect
4950 "?xml" -> return mempty
50− _ -> innerBlocks
51− where innerBlocks = mconcat <$> (mapM parseBlock $ elContent e)
51+ _ -> getBlocks e
52+ where getBlocks e' = mconcat <$> (mapM parseBlock $ elContent e')
5253 getInlines e' = (trimInlines . mconcat) <$>
5354 (mapM parseInline $ elContent e')
5455 isTitle e' = qName (elName e') == "title"
5556 skipWhite (Text (CData _ s _):xs) | all isSpace s = skipWhite xs
5657 | otherwise = xs
5758 skipWhite xs = xs
59+ listitems = mapM getBlocks $ findChildren (unqual "listitem") e
5860 getTitle = case findChild (unqual "title") e of
5961 Just t -> do
6062 tit <- getInlines t