diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-04-21 09:27:38 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-04-21 09:27:38 -0700 |
commit | 8d4680bbfe6cfcfc1890cf23491edc4fcc3bca04 (patch) | |
tree | 2189d1e1e0f449151c119cf78d9624814f96ff30 /src/Text/Pandoc | |
parent | 255897b66a0d6d3999ff1e923ebc925d46ff153c (diff) | |
download | pandoc-8d4680bbfe6cfcfc1890cf23491edc4fcc3bca04.tar.gz |
DocBook reader: Handle blockquote with attribution.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 826fed8b8..c69cdee10 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -33,7 +33,7 @@ List of all DocBook tags, with [x] indicating implemented: [ ] article - An article [x] articleinfo - Meta-information for an Article [ ] artpagenums - The page numbers of an article as published -[ ] attribution - The source of a block quote or epigraph +[x] attribution - The source of a block quote or epigraph [ ] audiodata - Pointer to external audio data [ ] audioobject - A wrapper for audio data and its associated meta-information [x] author - The name of an individual author @@ -118,6 +118,7 @@ List of all DocBook tags, with [x] indicating implemented: [ ] entrytbl - A subtable appearing in place of an Entry in a table [ ] envar - A software environment variable [ ] epigraph - A short inscription at the beginning of a document or component + note: also handle embedded attribution tag [ ] equation - A displayed mathematical equation [ ] errorcode - An error code [ ] errorname - An error name @@ -524,7 +525,15 @@ parseBlock (Text (CData _ s _)) = if all isSpace s parseBlock (Elem e) = case qName (elName e) of "para" -> para <$> getInlines e - "blockquote" -> blockQuote <$> getBlocks e + "blockquote" -> do + attrib <- case filterChild + (\e' -> qName (elName e') == "attribution") e of + Nothing -> return mempty + Just z -> (para . (str "— " <>) . mconcat) + <$> (mapM parseInline $ elContent z) + contents <- getBlocks e + return $ blockQuote (contents <> attrib) + "attribution" -> return mempty "sect1" -> sect 1 "sect2" -> sect 2 "sect3" -> sect 3 |