@@ -24,7 +24,7 @@ List of all DocBook tags, with [x] indicating implemented,
2424[ ] affiliation - The institutional affiliation of an individual
2525[ ] alt - Text representation for a graphical element
2626[ ] anchor - A spot in the document
27−[ ] answer - An answer to a question posed in a QandASet
27+[x] answer - An answer to a question posed in a QandASet
2828[x] appendix - An appendix in a Book or Article
2929[ ] appendixinfo - Meta-information for an Appendix
3030[ ] application - The name of a software program
@@ -307,9 +307,9 @@ List of all DocBook tags, with [x] indicating implemented,
307307[ ] pubsnumber - A number assigned to a publication other than an ISBN or ISSN
308308 or inventory part number
309309[x] qandadiv - A titled division in a QandASet
310−[ ] qandaentry - A question/answer set within a QandASet
311−[ ] qandaset - A question-and-answer set
312−[ ] question - A question in a QandASet
310+[o] qandaentry - A question/answer set within a QandASet
311+[o] qandaset - A question-and-answer set
312+[x] question - A question in a QandASet
313313[x] quote - An inline quotation
314314[ ] refclass - The scope or other indication of applicability of a
315315 reference entry
@@ -525,6 +525,14 @@ attrValue attr elt =
525525named :: String -> Element -> Bool
526526named s e = qName (elName e) == s
527527
528+-- meld text into beginning of first paragraph of Blocks.
529+-- assumes Blocks start with a Para; if not, does nothing.
530+addToStart :: Inlines -> Blocks -> Blocks
531+addToStart toadd bs =
532+ case toList bs of
533+ (Para xs : rest) -> para (toadd <> fromList xs) <> fromList rest
534+ _ -> bs
535+
528536-- function that is used by both mediaobject (in parseBlock)
529537-- and inlinemediaobject (in parseInline)
530538getImage :: Element -> DB Inlines
@@ -569,6 +577,8 @@ parseBlock (Elem e) =
569577 "sect5" -> sect 5
570578 "section" -> gets dbSectionLevel >>= sect . (+1)
571579 "qandadiv" -> gets dbSectionLevel >>= sect . (+1)
580+ "question" -> addToStart (strong (str "Q:") <> str " ") <$> getBlocks e
581+ "answer" -> addToStart (strong (str "A:") <> str " ") <$> getBlocks e
572582 "abstract" -> blockQuote <$> getBlocks e
573583 "itemizedlist" -> bulletList <$> listitems
574584 "orderedlist" -> orderedList <$> listitems -- TODO list attributes