@@ -511,6 +511,7 @@ data DBState = DBState{ dbSectionLevel :: Int
511 , dbAcceptsMeta :: Bool
511 , dbAcceptsMeta :: Bool
512 , dbBook :: Bool
512 , dbBook :: Bool
513 , dbFigureTitle :: Inlines
513 , dbFigureTitle :: Inlines
514+ , dbContent :: [Content]
514 } deriving Show
515 } deriving Show
516instance Default DBState where
517instance Default DBState where
@@ -519,12 +520,13 @@ instance Default DBState where
519 , dbMeta = mempty
520 , dbMeta = mempty
520 , dbAcceptsMeta = False
521 , dbAcceptsMeta = False
521 , dbBook = False
522 , dbBook = False
522− , dbFigureTitle = mempty }
523+ , dbFigureTitle = mempty
525readDocBook :: ReaderOptions -> String -> Either PandocError Pandoc
527readDocBook :: ReaderOptions -> String -> Either PandocError Pandoc
526readDocBook _ inp = (\blocks -> Pandoc (dbMeta st') (toList . mconcat $ blocks)) <$> bs
528readDocBook _ inp = (\blocks -> Pandoc (dbMeta st') (toList . mconcat $ blocks)) <$> bs
527− where (bs , st') = flip runState def . runExceptT . mapM parseBlock $ tree
529+ where (bs , st') = flip runState (def{ dbContent = tree }) . runExceptT . mapM parseBlock $ tree
528 tree = normalizeTree . parseXML . handleInstructions $ inp
530 tree = normalizeTree . parseXML . handleInstructions $ inp
530-- We treat <?asciidoc-br?> specially (issue #1236), converting it
532-- We treat <?asciidoc-br?> specially (issue #1236), converting it