git.iko.soy/typeable/pandoc
on master help sign in
DocBook reader: Support subtitle, simpara.
commitcb1096b75f257f5e7e61ac0de0545333f4263778 authorJohn MacFarlane <fiddlosopher@gmail.com> dateThu 10 May 2012, 09:01 (14 years ago) parenta408ce5
1 file changed+8−3
src/Text/Pandoc/Readers/DocBook.hs+8−3
src/Text/Pandoc/Readers/DocBook.hs+8−3
@@ -394,7 +394,7 @@ List of all DocBook tags, with [x] indicating implemented,
394394[ ] sidebar - A portion of a document that is isolated from the main
395395 narrative flow
396396[ ] sidebarinfo - Meta-information for a Sidebar
397−[ ] simpara - A paragraph that contains only text and inline markup, no block
397+[x] simpara - A paragraph that contains only text and inline markup, no block
398398 elements
399399[ ] simplelist - An undecorated list of single words or short phrases
400400[ ] simplemsgentry - A wrapper for a simpler entry in a message set
@@ -413,7 +413,7 @@ List of all DocBook tags, with [x] indicating implemented,
413413 a document
414414[x] subscript - A subscript (as in H2O, the molecular formula for water)
415415[ ] substeps - A wrapper for steps that occur within steps in a procedure
416−[ ] subtitle - The subtitle of a document
416+[x] subtitle - The subtitle of a document
417417[x] superscript - A superscript (as in x2, the mathematical notation for x
418418 multiplied by itself)
419419[ ] surname - A family name; in western cultures the last name
@@ -585,6 +585,7 @@ parseBlock (CRef _) = return mempty -- TODO need something better here
585585parseBlock (Elem e) =
586586 case qName (elName e) of
587587 "para" -> para <$> getInlines e
588+ "simpara" -> para <$> getInlines e
588589 "ackno" -> para <$> getInlines e
589590 "epigraph" -> parseBlockquote
590591 "blockquote" -> parseBlockquote
@@ -675,7 +676,11 @@ parseBlock (Elem e) =
675676 getTitle = case filterChild (named "title") e of
676677 Just t -> do
677678 tit <- getInlines t
678− modify $ \st -> st{dbDocTitle = tit}
679+ subtit <- case filterChild (named "subtitle") e of
680+ Just s -> (text ": " <>) <$>
681+ getInlines s
682+ Nothing -> return mempty
683+ modify $ \st -> st{dbDocTitle = tit <> subtit}
679684 Nothing -> return ()
680685 getAuthors = do
681686 auths <- mapM getInlines