aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-04-07 22:15:20 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-04-07 22:15:20 -0700
commit250fbef94d67885d39fadce9a01be3bd7a4d50e7 (patch)
tree0094bb50451d793a6db14dec109c2b655886c440 /src/Text/Pandoc
parent28497d484e85fd495e92f06416f978763f333518 (diff)
downloadpandoc-250fbef94d67885d39fadce9a01be3bd7a4d50e7.tar.gz
DocBook reader: look inside "info" elements for section titles.
Closes #1931.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/DocBook.hs5
1 files changed, 4 insertions, 1 deletions
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 }