aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-10-02 22:01:22 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2016-10-02 22:01:22 +0200
commitd0bfcbb8010f6e2b1d132e6b303ccb5024f05323 (patch)
treef47e6f9b78bee26d68951c457cc2005e2423ef33 /src/Text
parent46d8b42da5d42b981bc56c49416cec15abaf2d09 (diff)
downloadpandoc-d0bfcbb8010f6e2b1d132e6b303ccb5024f05323.tar.gz
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.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs10
1 files changed, 4 insertions, 6 deletions
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]