diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-05-01 22:36:38 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-05-01 22:36:38 -0700 |
commit | f1aaad9e86023dd90423681494dd24c48758c76f (patch) | |
tree | 2afae506ff144bdc4c83544e71d9e116cf6e4742 /src/Text/Pandoc/Writers | |
parent | 9b2f645e2adbdc61bfd626e4ce828cb072f29f71 (diff) | |
download | pandoc-f1aaad9e86023dd90423681494dd24c48758c76f.tar.gz |
EPUB writer: Use plain writer for metadata dc: fields.
This gives better results when we have, e.g. multiple paragraphs.
Note that tags aren't allowed in these fields.
Closes #2121.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/EPUB.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 9c6085a76..37c285dc2 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -57,6 +57,8 @@ import Text.Pandoc.Options ( WriterOptions(..) , ObfuscationMethod(NoObfuscation) ) import Text.Pandoc.Definition import Text.Pandoc.Walk (walk, walkM) +import Data.Default +import Text.Pandoc.Writers.Markdown (writePlain) import Control.Monad.State (modify, get, execState, State, put, evalState) import Control.Monad (foldM, mplus, liftM, when) import Text.XML.Light ( unode, Element(..), unqual, Attr(..), add_attrs @@ -226,8 +228,9 @@ addMetadataFromXML _ md = md metaValueToString :: MetaValue -> String metaValueToString (MetaString s) = s -metaValueToString (MetaInlines ils) = stringify ils -metaValueToString (MetaBlocks bs) = stringify bs +metaValueToString (MetaInlines ils) = writePlain def + (Pandoc nullMeta [Plain ils]) +metaValueToString (MetaBlocks bs) = writePlain def (Pandoc nullMeta bs) metaValueToString (MetaBool b) = show b metaValueToString _ = "" |