diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-06-20 14:21:43 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-06-20 14:21:43 +0200 |
commit | b26d3c45225184a882baad5cfb287f030d966104 (patch) | |
tree | d5219d5e1262fc2a04f98173a6edb4939ef769bf /src/Text/Pandoc | |
parent | 6a077ac9c79ac16d6af5409976e48ad80f42fd01 (diff) | |
download | pandoc-b26d3c45225184a882baad5cfb287f030d966104.tar.gz |
FB2 writer: don't fail with an error on interior headers (e.g. in list).
Instead, omit them with an INFO message.
Closes #3750.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/FB2.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/FB2.hs b/src/Text/Pandoc/Writers/FB2.hs index 20f94c185..f561133fb 100644 --- a/src/Text/Pandoc/Writers/FB2.hs +++ b/src/Text/Pandoc/Writers/FB2.hs @@ -37,7 +37,7 @@ FictionBook is an XML-based e-book format. For more information see: -} module Text.Pandoc.Writers.FB2 (writeFB2) where -import Control.Monad.Except (catchError, throwError) +import Control.Monad.Except (catchError) import Control.Monad.State.Strict (StateT, evalStateT, get, lift, modify) import Control.Monad.State.Strict (liftM) import Data.ByteString.Base64 (encode) @@ -371,8 +371,10 @@ blockToXml (DefinitionList defs) = needsBreak (Para _) = False needsBreak (Plain ins) = LineBreak `notElem` ins needsBreak _ = True -blockToXml (Header _ _ _) = -- should never happen, see renderSections - throwError $ PandocShouldNeverHappenError "unexpected header in section text" +blockToXml h@(Header _ _ _) = do + -- should not occur after hierarchicalize, except inside lists/blockquotes + report $ BlockNotRendered h + return [] blockToXml HorizontalRule = return [ el "empty-line" () , el "p" (txt (replicate 10 '—')) |