diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-04-14 21:43:07 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-04-14 21:43:07 -0700 |
commit | f0a1760d41f206eec99b44199e99db046def4d08 (patch) | |
tree | d4330988faac259c42efc1a864cf1ebc7e61c74a /src/Text/Pandoc | |
parent | d556840fc87d9c88da5c011492b0005a536c453c (diff) | |
download | pandoc-f0a1760d41f206eec99b44199e99db046def4d08.tar.gz |
Support orderedlist and ulink in docbook reader.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 882a568f5..53260e279 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -3,6 +3,7 @@ import Text.Pandoc.Parsing (ParserState(..)) import Text.Pandoc.Definition import Text.Pandoc.Builder import Text.XML.Light +import Data.Maybe (fromMaybe) import Data.Monoid import Data.Char (isSpace) import Control.Monad.State @@ -45,8 +46,9 @@ parseBlock (Elem e) = "sect6" -> sect 6 "section" -> gets dbSectionLevel >>= sect . (+1) "itemizedlist" -> bulletList <$> listitems + "orderedlist" -> orderedList <$> listitems -- TODO list attributes "articleinfo" -> getTitle >> getAuthors >> getDate >> return mempty - "programlisting" -> return $ codeBlock $ strContent e + "programlisting" -> return $ codeBlock $ strContent e -- TODO attrs "?xml" -> return mempty _ -> getBlocks e where getBlocks e' = mconcat <$> (mapM parseBlock $ elContent e') @@ -93,6 +95,9 @@ parseInline (Elem e) = case qName (elName e) of "subscript" -> subscript <$> innerInlines "superscript" -> superscript <$> innerInlines + "ulink" -> link + (fromMaybe "" (lookupAttrBy (\attr -> qName attr == "url") + (elAttribs e))) "" <$> innerInlines "emphasis" -> case lookupAttrBy (\attr -> qName attr == "role") (elAttribs e) of Just "strong" -> strong <$> innerInlines |