From d0bfcbb8010f6e2b1d132e6b303ccb5024f05323 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 2 Oct 2016 22:01:22 +0200 Subject: EPUB writer: use stringify instead of plain writer for metadata. This means that underscores won't be used for emphasis, or CAPS for bold. The metadata fields will just have unadorned text. Closes #3066. --- src/Text/Pandoc/Writers/EPUB.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 36ee716dd..c73155088 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -57,8 +57,6 @@ import Text.Pandoc.Options ( WriterOptions(..) , ObfuscationMethod(NoObfuscation) ) import Text.Pandoc.Definition import Text.Pandoc.Walk (walk, walkM, query) -import Data.Default -import Text.Pandoc.Writers.Markdown (writePlain) import Control.Monad.State (modify, get, State, put, evalState) import Control.Monad (mplus, liftM, when) import Text.XML.Light ( unode, Element(..), unqual, Attr(..), add_attrs @@ -228,10 +226,10 @@ addMetadataFromXML _ md = md metaValueToString :: MetaValue -> String metaValueToString (MetaString s) = s -metaValueToString (MetaInlines ils) = writePlain def - (Pandoc nullMeta [Plain ils]) -metaValueToString (MetaBlocks bs) = writePlain def (Pandoc nullMeta bs) -metaValueToString (MetaBool b) = show b +metaValueToString (MetaInlines ils) = stringify ils +metaValueToString (MetaBlocks bs) = stringify bs +metaValueToString (MetaBool True) = "true" +metaValueToString (MetaBool False) = "false" metaValueToString _ = "" getList :: String -> Meta -> (MetaValue -> a) -> [a] -- cgit v1.2.3