Support orderedlist and ulink in docbook reader.
This commit is contained in:
parent
d556840fc8
commit
f0a1760d41
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue