From 250fbef94d67885d39fadce9a01be3bd7a4d50e7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 7 Apr 2015 22:15:20 -0700 Subject: DocBook reader: look inside "info" elements for section titles. Closes #1931. --- src/Text/Pandoc/Readers/DocBook.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index f82158ab4..bb104a65a 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -11,6 +11,7 @@ import Data.Generics import Data.Monoid import Data.Char (isSpace) import Control.Monad.State +import Control.Monad import Control.Applicative ((<$>)) import Data.List (intersperse) import Data.Maybe (fromMaybe) @@ -868,7 +869,9 @@ parseBlock (Elem e) = parseRow = mapM (parseMixed plain . elContent) . filterChildren isEntry sect n = do isbook <- gets dbBook let n' = if isbook || n == 0 then n + 1 else n - headerText <- case filterChild (named "title") e of + headerText <- case filterChild (named "title") e `mplus` + (filterChild (named "info") e >>= + filterChild (named "title")) of Just t -> getInlines t Nothing -> return mempty modify $ \st -> st{ dbSectionLevel = n } -- cgit v1.2.3