Fixed merge bugs in Shared.
This commit is contained in:
parent
f34232c934
commit
16d6005ed9
1 changed files with 10 additions and 10 deletions
|
@ -97,7 +97,7 @@ import Text.Pandoc.MIME (getMimeType)
|
||||||
import System.FilePath ( (</>), takeExtension, dropExtension )
|
import System.FilePath ( (</>), takeExtension, dropExtension )
|
||||||
import Data.Generics (Typeable, Data)
|
import Data.Generics (Typeable, Data)
|
||||||
import qualified Control.Monad.State as S
|
import qualified Control.Monad.State as S
|
||||||
import Control.Monad (msum, unless)
|
import Control.Monad (msum, unless, liftM)
|
||||||
import Text.Pandoc.Pretty (charWidth)
|
import Text.Pandoc.Pretty (charWidth)
|
||||||
import System.Locale (defaultTimeLocale)
|
import System.Locale (defaultTimeLocale)
|
||||||
import Data.Time
|
import Data.Time
|
||||||
|
@ -527,24 +527,24 @@ makeMeta title authors date =
|
||||||
-- Variables overwrite metadata fields with the same names.
|
-- Variables overwrite metadata fields with the same names.
|
||||||
metaToJSON :: Monad m
|
metaToJSON :: Monad m
|
||||||
=> ([Block] -> m String) -- ^ Writer for output format
|
=> ([Block] -> m String) -- ^ Writer for output format
|
||||||
=> ([Inline] -> m String) -- ^ Writer for output format
|
-> ([Inline] -> m String) -- ^ Writer for output format
|
||||||
-> Meta -- ^ Metadata
|
-> Meta -- ^ Metadata
|
||||||
-> m Value
|
-> m Value
|
||||||
metaToJSON blockWriter inlineWriter (Meta metamap) = toJSON
|
metaToJSON blockWriter inlineWriter (Meta metamap) = liftM toJSON $
|
||||||
`fmap` Traversable.mapM (metaValueToJSON blockWriter inlineWriter) metamap
|
Traversable.mapM (metaValueToJSON blockWriter inlineWriter) metamap
|
||||||
|
|
||||||
metaValueToJSON :: Monad m
|
metaValueToJSON :: Monad m
|
||||||
=> ([Block] -> m String)
|
=> ([Block] -> m String)
|
||||||
-> ([Inline] -> m String)
|
-> ([Inline] -> m String)
|
||||||
-> MetaValue
|
-> MetaValue
|
||||||
-> m Value
|
-> m Value
|
||||||
metaValueToJSON blockWriter inlineWriter (MetaMap metamap) = toJSON
|
metaValueToJSON blockWriter inlineWriter (MetaMap metamap) = liftM toJSON $
|
||||||
`fmap` Traversable.mapM (metaValueToJSON blockWriter inlineWriter) metamap
|
Traversable.mapM (metaValueToJSON blockWriter inlineWriter) metamap
|
||||||
metaValueToJSON blockWriter inlineWriter (MetaList xs) =
|
metaValueToJSON blockWriter inlineWriter (MetaList xs) = liftM toJSON $
|
||||||
toJSON `fmap` Traversable.mapM (metaValueToJSON blockWriter inlineWriter) xs
|
Traversable.mapM (metaValueToJSON blockWriter inlineWriter) xs
|
||||||
metaValueToJSON _ _ (MetaString s) = return $ toJSON s
|
metaValueToJSON _ _ (MetaString s) = return $ toJSON s
|
||||||
metaValueToJSON blockWriter _ (MetaBlocks bs) = toJSON `fmap` blockWriter bs
|
metaValueToJSON blockWriter _ (MetaBlocks bs) = liftM toJSON $ blockWriter bs
|
||||||
metaValueToJSON _ inlineWriter (MetaInlines bs) = toJSON `fmap` inlineWriter bs
|
metaValueToJSON _ inlineWriter (MetaInlines bs) = liftM toJSON $ inlineWriter bs
|
||||||
|
|
||||||
setField :: ToJSON a
|
setField :: ToJSON a
|
||||||
=> String
|
=> String
|
||||||
|
|
Loading…
Reference in a new issue