git.iko.soy/typeable/pandoc
on master help sign in
DocBook reader: look inside "info" elements for section titles.
250fbefJohn MacFarlane
src/Text/Pandoc/Readers/DocBook.hs+4−1
@@ -11,6 +11,7 @@ import Data.Generics
11import Data.Monoid
11import Data.Monoid
12import Data.Char (isSpace)
12import Data.Char (isSpace)
13import Control.Monad.State
13import Control.Monad.State
14+import Control.Monad
14import Control.Applicative ((<$>))
15import Control.Applicative ((<$>))
15import Data.List (intersperse)
16import Data.List (intersperse)
16import Data.Maybe (fromMaybe)
17import Data.Maybe (fromMaybe)
@@ -868,7 +869,9 @@ parseBlock (Elem e) =
868 parseRow = mapM (parseMixed plain . elContent) . filterChildren isEntry
869 parseRow = mapM (parseMixed plain . elContent) . filterChildren isEntry
869 sect n = do isbook <- gets dbBook
870 sect n = do isbook <- gets dbBook
870 let n' = if isbook || n == 0 then n + 1 else n
871 let n' = if isbook || n == 0 then n + 1 else n
871− headerText <- case filterChild (named "title") e of
872+ headerText <- case filterChild (named "title") e `mplus`
873+ (filterChild (named "info") e >>=
874+ filterChild (named "title")) of
872 Just t -> getInlines t
875 Just t -> getInlines t
873 Nothing -> return mempty
876 Nothing -> return mempty
874 modify $ \st -> st{ dbSectionLevel = n }
877 modify $ \st -> st{ dbSectionLevel = n }