diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-12-08 23:16:30 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-12-08 23:16:30 -0800 |
commit | 626cefeac35afdf00fb85c01ed66f485f47b53a0 (patch) | |
tree | 8c547e35b0dc63fa787a7b09005892da3b0df926 /src | |
parent | 997d41636ff43f9d88112d0f01c8acb64b2b78dc (diff) | |
parent | 33fdb6bc1550de7cf1d5fa6735bb22adcbc0a7e9 (diff) | |
download | pandoc-626cefeac35afdf00fb85c01ed66f485f47b53a0.tar.gz |
Merge pull request #1795 from bos/master
DocBook reader: add support for calloutlist and callout
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 59ff3e717..463376ef0 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -70,8 +70,8 @@ List of all DocBook tags, with [x] indicating implemented, [x] book - A book [x] bookinfo - Meta-information for a Book [x] bridgehead - A free-floating heading -[ ] callout - A “called out” description of a marked Area -[ ] calloutlist - A list of Callouts +[x] callout - A “called out” description of a marked Area +[x] calloutlist - A list of Callouts [x] caption - A caption [x] caution - A note of caution [x] chapter - A chapter, as of a book @@ -603,7 +603,7 @@ isBlockElement (Elem e) = qName (elName e) `elem` blocktags "important","caution","note","tip","warning","qandadiv", "question","answer","abstract","itemizedlist","orderedlist", "variablelist","article","book","table","informaltable", - "screen","programlisting","example"] + "screen","programlisting","example","calloutlist"] isBlockElement _ = False -- Trim leading and trailing newline characters @@ -712,6 +712,7 @@ parseBlock (Elem e) = "question" -> addToStart (strong (str "Q:") <> str " ") <$> getBlocks e "answer" -> addToStart (strong (str "A:") <> str " ") <$> getBlocks e "abstract" -> blockQuote <$> getBlocks e + "calloutlist" -> bulletList <$> callouts "itemizedlist" -> bulletList <$> listitems "orderedlist" -> do let listStyle = case attrValue "numeration" e of @@ -785,6 +786,7 @@ parseBlock (Elem e) = contents <- getBlocks e return $ blockQuote (contents <> attrib) listitems = mapM getBlocks $ filterChildren (named "listitem") e + callouts = mapM getBlocks $ filterChildren (named "callout") e deflistitems = mapM parseVarListEntry $ filterChildren (named "varlistentry") e parseVarListEntry e' = do |