diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-05-10 09:01:38 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-05-10 09:01:38 -0700 |
commit | cb1096b75f257f5e7e61ac0de0545333f4263778 (patch) | |
tree | ed5f2e0684b09fbf596c8deabab0e256e25b6d27 /src/Text/Pandoc/Readers | |
parent | a408ce5fd70c32ccad869f71ff8e8fd7c2611c36 (diff) | |
download | pandoc-cb1096b75f257f5e7e61ac0de0545333f4263778.tar.gz |
DocBook reader: Support subtitle, simpara.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 9a655205c..00d668120 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -394,7 +394,7 @@ List of all DocBook tags, with [x] indicating implemented, [ ] sidebar - A portion of a document that is isolated from the main narrative flow [ ] sidebarinfo - Meta-information for a Sidebar -[ ] simpara - A paragraph that contains only text and inline markup, no block +[x] simpara - A paragraph that contains only text and inline markup, no block elements [ ] simplelist - An undecorated list of single words or short phrases [ ] simplemsgentry - A wrapper for a simpler entry in a message set @@ -413,7 +413,7 @@ List of all DocBook tags, with [x] indicating implemented, a document [x] subscript - A subscript (as in H2O, the molecular formula for water) [ ] substeps - A wrapper for steps that occur within steps in a procedure -[ ] subtitle - The subtitle of a document +[x] subtitle - The subtitle of a document [x] superscript - A superscript (as in x2, the mathematical notation for x multiplied by itself) [ ] surname - A family name; in western cultures the last name @@ -585,6 +585,7 @@ parseBlock (CRef _) = return mempty -- TODO need something better here parseBlock (Elem e) = case qName (elName e) of "para" -> para <$> getInlines e + "simpara" -> para <$> getInlines e "ackno" -> para <$> getInlines e "epigraph" -> parseBlockquote "blockquote" -> parseBlockquote @@ -675,7 +676,11 @@ parseBlock (Elem e) = getTitle = case filterChild (named "title") e of Just t -> do tit <- getInlines t - modify $ \st -> st{dbDocTitle = tit} + subtit <- case filterChild (named "subtitle") e of + Just s -> (text ": " <>) <$> + getInlines s + Nothing -> return mempty + modify $ \st -> st{dbDocTitle = tit <> subtit} Nothing -> return () getAuthors = do auths <- mapM getInlines |